Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Direct association implemetation in java

Status
Not open for further replies.

adamtong

Programmer
Dec 21, 2011
1
CA
Hi,

I would like to know how do you implement a direct association in java. Say i have two classes: Player and Ball related with direct association. How can I implement those two classes and their relationship in Java or php?

Do you know a link that gives examples of implementations for each kind of relationship?

Thanks
 
You can associate them in either direction, or both. Add a Ball property to the Player object whose value is a reference to a Ball object. Do the reverse also if the Ball needs to call functionality in the Player object, which seems a bit unlikely.

An unforeseen consequence of the information revolution has been the exponential propagation of human error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top