aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Question about UniDirectional Assosiation in ClassDiagram Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Question about UniDirectional Assosiation in ClassDiagram" Watch "Question about UniDirectional Assosiation in ClassDiagram" New topic
Author

Question about UniDirectional Assosiation in ClassDiagram

Chakri Srihari
Greenhorn

Joined: Sep 13, 2007
Posts: 4
I am going through "UML distilled" book by martin flower and I got the following scenario.

There is an Uni Directional Assosiation from Order to OrderLine

like

Order ---> OrderLine


But the code which representing above relation is given as


Public class OrderLine {


.......
private Order
.........

}

i.e OrderLine class has Order as instance variable .


Is it correct representation ?



Chakra
Henrique Ordine
Ranch Hand

Joined: Sep 03, 2004
Posts: 127
Hello Chakra,

I've been using together for eclipse and when I draw associations it gives me 3 choices for navigation: NAVIGABLE, NAVIGABLE EXPLICITLY and NOT NAVIGABLE. This is for a UML 2.0 project by the way. When NOT NAVIGABLE is selected an X marks the NOT NAVIGABLE end.
For example: order -X----> orderline.
I'm not sure what the UML 2.0 spec says about this though.
Still, it looks like that example has been miswriten.


J2EE Architect/Developer
Shashi Agrawal
Greenhorn

Joined: Aug 02, 2007
Posts: 9
Mark Cade has shown bi-directional association between Order and LineItem in his case study.

[Order] 1 --- * [LineItem]
Chakri Srihari
Greenhorn

Joined: Sep 13, 2007
Posts: 4
Thanks Guys for the replies.
Chakri Srihari
Greenhorn

Joined: Sep 13, 2007
Posts: 4
It looks like Martin flower also corrected this code in the next printing .

I found this info in book's errata.(http://martinfowler.com/umlsupp/umlErrata.html)
"
Page 39: In the code at the end the line "private Order order;" should be deleted. (There's no navigability from order line to order in fig 3.1 so there should be no field). For the same reason in code at the top of page 40 the line "public Order order;" should also be deleted. [Corrected in the 8th Printing]

"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about UniDirectional Assosiation in ClassDiagram