This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Java in General and the fly likes Compostion,Association and aggregation in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Compostion,Association and aggregation in java" Watch "Compostion,Association and aggregation in java" New topic

Compostion,Association and aggregation in java

anish jain
Ranch Hand

Joined: Feb 03, 2010
Posts: 129
I want to know how to implement Compostion,Aggregation and Association in Java.

I searched many time but never got any satisfactroy answer
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Please, SearchFirst
john sal
Ranch Hand

Joined: Jul 30, 2010
Posts: 93
Stephan van Hulst wrote:Please read the message following this post


In the case of composition, the Engine is completely encapsulated by the Car. There is no way for the outside world to get a reference to the Engine. The Engine lives and dies with the car. With aggregation, the Car also performs its functions through an Engine, but the Engine is not always an internal part of the Car. Engines may be swapped, or even completely removed. Not only that, but the outside world can still have a reference to the Engine, and tinker with it regardless of whether it's in the Car.
Stephan van Hulst

Joined: Sep 20, 2010
Posts: 3892

John, I appreciate that you're helping other users out; but when you cite material written by someone else, please provide a link to the source.

The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
john sal
Ranch Hand

Joined: Jul 30, 2010
Posts: 93
Sure I will take care of it in future.

subject: Compostion,Association and aggregation in java
It's not a secret anymore!