• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Association Vs Dependency

 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


In cade's class diagram dependency is shown between Order and lineItem which would most likely be implemented as CMP-CMR relationship with Order EB having the below
public abstract Collection getLineItems()

e.g returning LineItem collection object from some method which is a dependency trait rather than an association trait(exihibited by presence of instance variable).Am I missing something?

With my understanding one example of association would be a SFSB if that is keeping some instance variables e.g userData which is used across multiple method invocations .

Can anybody validate my understanding.


Thanks.
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajai,

You said:

In cade's class diagram dependency is shown between Order and lineItem which....



Are you sure about it? I'm looking at this diagram on page #169 (not sure about the book's version) and it shows a solid line between Order and LineItem, which denotes an association. Since there are no arrows on the sides it is a bidirectional association.

-- Dan
 
Ajai
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Dan.

It should have been association.
I understand that there is ownership relationship between order and line item and thats why relationship is association but my doubt comes when we implement or code this relationship.


Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic