Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'd like to write down the design of my program to understand the dependencies and calls better. I know there are class diagrams which show inheritance and attribute variables.

However I'd also like to document the input parameters to method functions and in particular which calls the methods function executes inside (e.g. on the input parameters).

Also sometimes it might be useful to show how actual objects are connected (if there is a standard structure).

This way I can have a better understanding of the modules and design before starting to program. Can you suggest a method to do this software design? It should be one-to-one to programming code structure so that I really notice all quirks beforehand (instead of high-level design where thing are hard to implement without further work). Maybe some special diagram or tool or a combination?

It is static dependency and call design rather than time dependent execution monitoring.

(I use Python if you have any specialized recommendations).

share|improve this question

closed as not constructive by FrustratedWithFormsDesigner, pdr, Jim G., ChrisF Oct 12 '12 at 22:47

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

If you want something as concrete as code, write code. –  delnan Jun 7 '12 at 13:35
Questions about programming tools are usually considered more on-topic at stackoverflow: stackoverflow.com/questions (See the FAQ here: programmers.stackexchange.com/faq) You could search there to see if such a question has already been asked (and maybe even answered). You can also flag your own question to have the moderators migrate to StackOverflow if you think it would be better there. –  FrustratedWithFormsDesigner Jun 7 '12 at 13:50
A google search for "Python call chart" yields this: pycallgraph.slowchop.com Is this what you are looking for? –  FrustratedWithFormsDesigner Jun 7 '12 at 14:22
@delnan: It shouldn't be concrete code, but an overview that theoretically translates to code pieces. It's called software design. –  Gerenuk Jun 7 '12 at 16:44
@Designer: Thanks for the suggestion! It's not so much about the tools, but rather the right method to approach this. For example the right diagrams as Ozair suggested. I'm new to UML and wasn't sure how to approach my particular design system. Pycallgraph helps to create such a graph but it is dynamic and graphs produces are a bit messy. So I wanted to design by hand :) –  Gerenuk Jun 7 '12 at 16:46

2 Answers 2

up vote 3 down vote accepted

I don't think there is any one diagram standard to represent everything.

Typically, I think for going from requirements to design, I would follow these steps:

  1. Use case diagrams
  2. Sequence diagrams
  3. Class Diagrams

You might also want to have a look at Collaboration diagrams.

The use cases give a higher level approach which you can skip in your case.

I have found the sequence diagrams most helpful in drawing out my mind. It helps put on paper the first logical objects and the interactions between them. I have also found these to be most helpful in understanding the behavior of an already built system.

Once those are clear and if you need then you can start making a class diagram with as much detail as you want. Class diagrams are static. If you are using a good IDE, you will hardly miss class diagrams.

share|improve this answer
Thanks a lot for the suggestion. That's the kind of approach I'm looking for. It wasn't clear to me what to use since "use case" seems too high-level, "sequence" too centered on a particular call flow rather than all possibilities more packed in one graph and "class" design isn't complex in my case. I though a mixture of "sequence" and "class". But I will just try your proposal :) I use Eclipse for Python. –  Gerenuk Jun 7 '12 at 16:49
The OP may also want to look at collaboration diagrams (e.g.: agilemodeling.com/style/collaborationDiagram.htm. However, OP's requirement for analyzing input to each method is a bit out of the ordinary kind of requirement specially before design. In general a method gets just enough data to to do its work and that is that. –  Emmad Kareem Jun 7 '12 at 18:08
@Gerenuk: You can help me and yourself and this community by accepting the answer –  Ozair Kafray Jun 8 '12 at 18:47
It's been one day and this is the first answer only. Actually Emmads suggestion is slightly better. Maybe there are even better answers. It doesn't sound nice if you demand it this way. –  Gerenuk Jun 9 '12 at 7:51

However I'd also like to document the input parameters to method functions and in particular which calls the methods function executes inside (e.g. on the input parameters).

You're either solving the wrong problem or beginning at the wrong level of abstraction.

Consider the following quote:

"Bad programmers worry about the code. Good programmers worry about data structures and their relationships."

...And ask yourself, "Why do I need to worry about all of the methods and all of the input parameters in an application?"

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.