tags:

views:

215

answers:

3

Hello,

I need to know this differences in order to undestand how to use them right.

Which are the differences of DFD and Activity diagram?

+1  A: 

Actually, it's reasonably logical. You only have to look at the names.

In data flow diagrams, the lines between "boxes" represent data that flows between components of a system. Because these only show the flow of data, they do not give an indication of sequencing.

In activity diagrams, those lines are simply transitions between activities and do not represent data flow at all. They more represent the sequencing of activities and decisions. You can tell from these what order things happen in.

That's a simplistic explanation but should be a good starting point. Further information can be garnered from Wikipedia for DFDs and activity diagrams.

paxdiablo
@pax: activity diagrams may also show object flow.
John Saunders
@John, I've never seen them used that way. The lines have always represented control flow rather than data flow. In fact we were taught originally they they were just flowcharts with concurrency :-) Of course I could be wrong in this, it wouldn't be the first time but I would think that the only way to do it would be to still treat it an a control-flow diagram but have certain objects flow _with_ the control.
paxdiablo
A: 

alt text

John Saunders
John, if you've posted this as an answer to my "I've never seen them used that way" comment, you probably should have just put a link to the diagram in as a comment. As it stands, this is not really an answer to the question and it wouldn't change my answer anyway. The ability to _carry_ data with control flow is irrelevant to the fact that an activity diagram is still primarily about control while a DFD is data flowing between parts of a system.
paxdiablo
@pax: actually, those are object flows between a1, o1, a3 and ap1, ap2. Unfortunately, they look the same as control flows, but they are object flows.
John Saunders
A: 

Explicit bias: I'm a DFDs proponent.

@John is correct that Activity diagrams can be used to represent object flow. @pax equally correct they seldon are.

Two big DFD advantages for me:

  1. Link to object model. Data stores on a DFD provide a really nice way to link the data produced / consumed to the object model. Very useful for consistency and ensuring your thinking is joined up.

  2. They de-emphasise control flow. Far too often designs over-constrain sequencing. Activity diagrams do support concurrency - but it requires the user to (a) remember and (b) use it. So the default is over-serialisation. DFDs don't. They lay bare the real sequence dependencies without any extra effort on the part of the user. Consequently they also make it easier to see causal relationships. If processes a and b both require data input D then it's obvious on the diagram. And hence parallel activity is obvious.

Don't get me wrong - I'm not against Activity diags. Where control flow is the primary consideration I'll use an AD over a DFD. But empirically I'd say I find DFDs a more useful tool in ~70-80% of cases.

Of course, YMMV.

sfinnie