Book a Demo

Author Topic: Activity diagram: dependency <-> object flow  (Read 10438 times)

Harro_Kremer

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Activity diagram: dependency <-> object flow
« on: July 30, 2004, 02:26:45 am »
What's the difference between a dependency from an object to an activity and an object flow?

For example,
    [1]When activity A depends on object D, a dependency seems better.  
    [2] When activity B produces object D, an object flow seems better.
    [3] When activity B produces object D that is subsequently used by A, an object flow seems better for both relations.

Are the relations "A depends on D" (first item) and "A uses D"(part of third item) the same?

My feeling is that they are not the same, because linguistically, a "use" relation implies a dependency onto the necessary inputs.

Any comments?

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Activity diagram: dependency <-> object
« Reply #1 on: August 04, 2004, 04:49:08 pm »
IMO a dependency is a fairly uncategorised relationship, albeit one that is supported by a rather large range of standard stereotypes.  Typically dependencies are used early in analysis work when the actual relationship is less well defined.  For example in our logical design level models we find a lot of <<use>> dependencies between components and between logical classes (or business objects etc).
As design gets more sophisticated these dependencies tend to get replaced by other relationships, as in your example by an object flow.

Having said that....

We see a FAQ at our site regarding control flows vs object flows - when do I use etc.  My own interpretation of the answer is as follows - it may not necessarily be "High Church" UML but it works for me, hey!

Both object and control flows are only used between actionable elements (activities, actions etc) not between actionables and structural elements (objects, components etc). Both flows are visually similar and the distinction can be immaterial to any of the audience.  They do, on the other hand, provide a means of distinction for the experienced practicioner - between transfer of control betwen two actionables based purely on an abstract - such as the flow of time say - and transfer based on some physical exchange of an object - say a completed timesheet.

So why distinguish anyway? Purely to avoid having to explicitly include the structural element in the diagram.  The name of the object flow defines the object being transferred.  Imagine, for the sake of hyperbole, a model diagram of a buiness flow that involved the movement of a business form through, say 30 odd activities.  Since the form object can only appear once in the diagram we would end up with 30 dependencies between each activity and the object element.  Not so easy to read.  Using object flows - each named "form BQZ310" for example, the same information is conveyed in a much conciser format.

Now lets look at the relatioship between an actionable and a structural element - activity A  to object D for instance.  In the early stages of analysis, all we know is that somehow A depends on D.  Cool, bang an unstereotyped dependency link between them - from A to D.  Similarly D seems to have come from something to do with B, so bung a dependency between  D and B (note reversal of the direction).  For the sake of local nomeclature B seems to "produce" D (other places may create it, build it ... whatever) So lets stereotype the D to B dependency as <<produced by>>.

So what have we got?  A model expressed from the viewpoint of A that it is dependent on a D thing that is produced by that other famous activity B:

[A] ---<<uses>> -----> {D} -----<<produced by>>---->

(This diagram can of course be simplified if required to:

  [A] - - - - - - - >

where the dependency description in the note on the link says "A uses the D object produced by B")


Finally, remember that the choice of digramming style is up to you within the constraint of effectively communicating the issues & answers of your model with your audience.  As I said above, this is how we have "standardised" our use of the less well defined depency relationship for modelling at the business or logical level.  At deeper design levels, where exact characterisation of the relationships are more important we find the generic dependency is typically not enough and they ar replaced with the more meaningful relationships.


hth
Bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

paperless

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Activity diagram: dependency <-> object
« Reply #2 on: August 05, 2004, 12:19:16 am »
Hi,

I believe, Association is conceptually at different layer of abstraction then dependency.

When I have a Derived element, is has "dependency" not "association" relationship with the element (from which it can be
derived).

Similarly, when I can trace from Use case to its realization classes. Is the relationship between them is "association" or
"dependency".

In both the cases you will find it makes semantically more meaningful if we express that as "dependency".

Also consider a situation in which one element requires the presence of another element for its
correct implementation. Like suppose I have to instantiate an object of particular type and pass its reference to another
operation call to some object, to provide correct behavior of my object, this kind of dependency for the correct usage of
object is also kind of dependency.

So really speaking both of them provide different abstraction levels. While association tries to show semantic relationship
among collaborating objects whereas dependency tries to show dependency on particular activity (create, instantiate, call
etc.) or even among elements belonging to different models (Like use case model and class model).

Going by that I believe Harro is correct in the understanding of dependency and object flow when he says

[1]When activity A depends on object D, a dependency seems better.  
[2] When activity B produces object D, an object flow seems better.
[3] When activity B produces object D that is subsequently used by A, an object flow seems better for both relations.


regards,
Shashank

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Activity diagram: dependency <-> object
« Reply #3 on: August 08, 2004, 08:43:29 pm »
If, as per the EA glossary

derived element : A model element that can be computed from another element, but that is shown for clarity or that is included for design purposes even though it adds no semantic information.  

Then
Quote
When I have a Derived element, is has "dependency" not "association" relationship with the element (from which it can be
derived).  
is agreed and is in accrodance with what  said about the genercity of the dependance relationship.  In this specific instance it will be unlikely that the derived element and the relationship will be carried forward in the design.

Quote
Similarly, when I can trace from Use case to its realization classes. Is the relationship between them is "association" or
"dependency".  

I would have thought a realization link to be more appropriate than a dependency in this case.

Quote
Also consider a situation in which one element requires the presence of another element for its  
correct implementation. Like suppose I have to instantiate an object of particular type and pass its reference to another
operation call to some object, to provide correct behavior of my object, this kind of dependency for the correct usage of
object is also kind of dependency.  

It most certainly is a dependency. However, you have already categorized it by documenting a specific interaction between the instantiated object and the one that has the dependency.  In fact, it would appear that by progressing the discussion to the point of specifying that the instantiation reference itself is passed you may have categorised it to the point of an object flow.  However what is unlear is the identity of the creator and the mechanism by which the reference is passed, so perhaps it would be better that the flow remain a dependency until these matters are resolved.

Finally, Harro's original query wa on the differentiation of dependencies and object flows, not associations.

B




"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.