Responding to maurice_t...
> But sometimes two things have to be done which could be solved
> serially but this would mix up the data tokens and lessen the
> clearness of the activity. Imagen, two Users shall be fetched,
> compared and the 'better' one shall be printed. In a serial version it
> would like this (p = parameter, a = action, o = object)
>
> p: userId -> a: fetchUser1 -> a: fetchUser1 -> a: compareUsers -> o:
> User[winner] -> a: printUser -> activity end
>
> Rgis chain could be extended by much more objects that are loaded
> (contracts, orders etc ..). If I got the token concept right, every
> data token from each action reaches the printUser action, which can
> use any of them on demand.
>
The flows just represent algorithmic flow of control in the solution;
not data flows. (Interaction Diagrams are the closest UML notation to
classic DFDs, at least in an OO context.) The tokens are simply messages
and there is no specification of whether they have data packets. So your
diagram will work fine; it just implies that the fetch activities merely
store the data as object attributes so it can be conveniently accessed
by subsequent processes.
[In an OO context well-formed applications rarely pass data in behavior
collaboration messages. That's because OO methods are supposed to
navigate to whatever data they need themselves (in OOA/D; nonfunctional
requirements may dictate passing data during OOP). That makes data
integrity much easier to manage at OOP time for distributed or
concurrent implementations. So the only time data is passed in a message
is when requirements mandate special synchronization, such as grouping
sensor samples in a particular time slice.]
> Sometimes I see that - apparently for reasons of clearness - such a
> chain is forked although no real parallelism is intended:
>
> _ a: fetchUser1 -
> p: userId -> > -> a: compareUsers -> o:
> User[winner] -> a: printUser -> activity end
> - a: fetchUser1 -
>
This is actually the preferred way to do it because it is very clear
that the two fetches can be processed in parallel. In your first diagram
that cannot be assumed, even if it is true. That can be critically
important at OOP time if one implements the OOA/D model for concurrent
processing.
However, that is much less important today than it was two decades ago.
One now has MDA Marking Models to guide OOP for things like concurrent
processing when necessary. So today many developers don't bother with
fork/join just to specify concurrency opportunities and will only use
them for more obscure flow of control issues.
> So my questions are, did I get the token concept right? Is there any
> preffered way of illustrating the data tokens of interest or is it
> expected that the reader tracks _all_ data tokens, which were produced
> and has to accept, that only some of them are used by the following
> actions?
>
If you want to specify data packets you can do that in an Interaction
Diagram.
In fact, you really don't need ADs at all today, at least in OO
contexts. All you need are Class Diagrams, Component Diagrams, State
Charts, and an Abstract Action Language (AAL) for specifying behavior
responsibilities. Any translation transformation engine can
unambiguously generate correct 3GL or Assembler code from OOA models
using just those notations. (Though a transformation engine can generate
an Interaction Diagram automatically from the other diagrams for
documentation, white board IDs are useful for keeping track of things
when developing the other diagrams.)
Historically ADs were primarily used to describe behavior
responsibilities when UML was first introduced. However, they are
verbose and tend to be a pain to maintain (a new bubble always seems to
go in the middle of the densest part of the diagram). So they have been
largely replaced for describing methods by text-based AALs that were
introduced once OMG defined an execution meta model for UML.
Some people still use ADs to document large-scale processing; sort of
the Executive Summary overview of the processing. ADs are also central
to some non-OO development methodologies. But today subsystems are much
smaller and that sort of overview is no longer necessary, at least for
disciplined OO development.
--
Life is the only flaw in an otherwise perfect nonexistence
-- Schopenhauer
H. S. Lahman
H.la...@verizon.net
software blog:
http://pathfinderpeople.blogs.com/hslahman/index.html