Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Attributes: object instance vs object id

 
Sanz Vai
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Plane contains a Seat. This association is shown by an arrow from Plane to Seat. How do we show that a Plane contains a Seat? Do we have an attribute of type Seat in Plan class or do we have a int or String type refering to a Seat id? Basically an id will be a primary key of the Seat in DB or some unique value that can be used to get Seat details from the DB.
If Plane class doesn't have an attribute of type Seat, is it still an Association, and not Dependency?
 
Sanz Vai
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have noticed in many class diagrams (in books etc) that an attribute representing a Seat is not shown in a class say Plane. For eg. goto the following link:
http://bdn.borland.com/article/0%2C1410%2C31863%2C00.html#classdiagrams
Why doesn't the Customer class have an attribute of type Order??? Or a List/Collection of Orders?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic