0
votes

I have a simple flow which I would like to describe using UML in best way possible. I have no experience with UML and do not want to chose ridiculous diagram type.

DataA --> ProcessorA --> DataB --> ProcessorB ... --> DataN -->ProcessorN

In nutshell, Data is collection of data in some structure and Processor x transform input data into data to be used by Processor X + 1.

Where Data and Processor are actual classes and it would be nice to show how this works in code - for processing a certain data usually the new processor must be created with the data object, something like process() method invoked on it which returns data as input for next processor.

I tried to study dynamic UML diagrams but I am not sure which type is best to use for this.

2
Did you try to study this en.wikipedia.org/wiki/Data_flow_diagram? Also this agilemodeling.com/essays/umlDiagrams.htm page may help you decide which type suites your needsxmojmr

2 Answers

3
votes

Activity diagram is a perfect choice for data flow behaviors. You can use them to show everything you stated and lots more, especially if you complement acticity diagram with some other UML diagrams. In this case I would recommend class diagram, as these data structures are probably important and should also been specified.

Here is a simple example of your situation.

The following diagram is an activity diagram: enter image description here

It is very intuitive and I guess you will be able to interpret it even without studying UML. Besides this simple sequence flow, you can also model paralel activities, choices (if-then for example), events, responsabiities, etc. You can even "open" the single activities and model then internally with another level of activities.

Those grey elements show the data that is flowing in and out of single actions/activities.

The best thing in UML is combining several diagrams to show different aspects of your problem. Here it is reasonable to somehow explain how the Data A, Data B and other data objects actually look like. In UML there is a diagram for this, a class diagram:

enter image description here

I showed just basic features here. Classes model complex data, are usually equipped with attributes and have realtionshipss of different kinds with other classes. Here you can see how the actial data look like (in contrast to activity, which shows what is done with the data)

Class diagram is one of the structural UML diagrams, while activity diagram is typical behavior diagram. They work best together.

1
votes

I presume that the sequence diagram would be the best one for your case, because your lifeline would represent your object (or class) and the interaction message between your object would represent your method. You would also have a chronology with this diagram. This diagram is focus on the interaction from your object. You can see it : http://en.wikipedia.org/wiki/Sequence_diagram