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 am working on a small Delphi project, composed of two units. One unit is for the GUI, and the other for data management, file parsing, list iterating and so on.. I've already made a class diagram, and my workflow looks like hell- it's too complex, even for anyone to read. I've considered making a dataflow diagram, but it would be even more complex. A use case diagram wouldn't be of use either. Am I missing some diagram type which could somehow represent the relationship between my two units?

share|improve this question
1  
When all of your diagrams are too complex, perhaps your project's architecture is too complex? –  Doc Brown Nov 9 '12 at 16:59

3 Answers 3

up vote 2 down vote accepted

If you want to show static relationships between your components, then UML Component Diagram should help you. If you want to show interactions between these components, then try to use UML Sequence Diagram. You should also remember about staying at the same level of abstraction, e.g. don't go into details (like pressing checkbox), when you're trying to describe the system on the component level ("gui" vs "other" unit). Your workflow diagram doesn't have much sense right now, as it should focus on a specific scenario (e.g. loading a report) rather than trying to show all possible scenarios on a single diagram.

Also I think that you have more serious problem underneath, as you "other unit" is just doing too much work, and is clearly breaking the Single Responsibility Principle. You could think about splitting the "other unit" into more components, each of them taking just a specific responsibility (e.g. parsing files, generating reports, sorting reports).

share|improve this answer
1  
Good answer. I totally agree about the SRP code smell, but it refactoring isn't an option at this point. I will try a sequence diagram for a single scenario. Thanks –  Goran_Mandic Nov 10 '12 at 16:51

Classic UML Diagram References

Two great references for UML and its many diagram types include Martin Fowler's UML Distilled in which each diagram is described in much the same way as you might expect a pattern to be described (it is named, described, the forces on it are enumerated, and the applicability is identified). A more comprehensive reference is Grady Booch (et. all) in Object Oriented Analysis and Design with Applications.

Nested State Diagrams

You mention that your workflow looks like hell, and often the art of doing a good diagram is its level of detail. The Booch reference has great material about nested state machines that knocked my socks off when I read it. A state diagram can have a boat load of states and transitions, but by using their nested representation a lot of transitions that can happen from any state can be represented in an outer diagram and the transitions that are most specific to a locality of a few states can be represented by an inner diagram.

Activity Diagrams

Workflow might lend itself to being shown in an activity diagram. Activity diagrams are superior to flow chart in several ways, but can represent some similar things like decisions and iteration. One thing I like about them is that they show parallel activities, and sometimes represent the division of labor in the system using partitions or as they are more commonly called, swim lanes. They can also represent synchronization with a synchronization bar that has one arc coming in and multiple arcs going out (fork) and multiple arcs coming in and a single arc going out (join). Like state machines, UML also permits activity diagrams to be nested to better structure and to limit the level of detail.

Data Flow Diagrams

If you don't mind a blast from the past, one diagram from structured diagram that UML rejected but for which I believe UML has not given a fully satisfying replacement is the data flow diagram (DFD). This type of diagram is beautifully simple in its use of four symbols to show a process, data store, data flow, and external entities. External entities are show at the right and left sides of the diagram to show who or what provides inputs and outputs to the system, the data is labelled as it is passed from one data transforming process to another. If data is sourced from or produced for storage, that too is shown, typically with the data stores located below the processes that consume/produce them.

Using Diagrams to Design Better

Many other diagrams are available. Your favorite diagram editor might expand or limit your choices. Ideally, diagrams should help you improve the consistency and completeness of your designs. A complex hard to draw diagram might be telling you that your design is too complex, and may even show you some relationships that you can make simpler.

share|improve this answer
    
+1, for a lot of info, but rmaruszewski's answer gave me a better idea about what to do. Thanks:) –  Goran_Mandic Nov 10 '12 at 16:53

My suggestion would be creating an architecture diagram to illustrate the high level idea of the whole project.

also if class diagram is too complex then break them units and show the interaction of units rather than all classes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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