This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Relationship between classes

 
david colais
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys...
How to represent the relationship classes btw classes in code for eg:if association or genralization is asked to represent in code.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use real words when posting to the forums. Abbreviations such as "btw" in place of "between" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please click this link ⇒ UseRealWords for more information.
 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please restate your question. What are you trying to do? Can you give an example of a situation that requires defining or coding the relationship between classes?
 
david colais
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for not being clear...
@Greg Brannon :What i wanted to ask was that how should i implemement the code if there is a generalization relationship for example:Like if a truck is made up a number of parts.
My doubt is that how do i represent this reationship between two calsses of truck and parts in the code.
Is it there to just help us understand the situation or do we need to implement the relationship in the code.Please help........
 
Campbell Ritchie
Sheriff
Posts: 48445
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I always thought "btw" meant "by the way", which is another reason for not using such abbreviations.

You will find discussion about aggregation association and composition here. you will have to read the whole thread to find where the mistake was made.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic