Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about UniDirectional Assosiation in ClassDiagram

 
Chakri Srihari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Shashi Agrawal
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark Cade has shown bi-directional association between Order and LineItem in his case study.

[Order] 1 --- * [LineItem]
 
Chakri Srihari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guys for the replies.
 
Chakri Srihari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]

"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic