aspose file tools*
The moose likes Beginning Java and the fly likes Relationship between classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Relationship between classes" Watch "Relationship between classes" New topic
Author

Relationship between classes

david colais
Greenhorn

Joined: Nov 15, 2010
Posts: 29
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

Joined: Jan 10, 2002
Posts: 61424
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 561
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?


Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
david colais
Greenhorn

Joined: Nov 15, 2010
Posts: 29
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

Joined: Oct 13, 2005
Posts: 39409
    
  28
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.
 
Consider Paul's rocket mass heater.
 
subject: Relationship between classes