Difference between composition and aggregation, JAVA Programming

Aggregation

Composition

Aggregation :  An  association   in  which  one  class refers to collection or a another class. This is a part of  a  whole   relationship  where  the  phase   can  exist without the whole .

e.g.: A line item is whole and the products are the phases. If a line item is deleted then the products have not be deleted .

Composition :  An  association   in  which  one  class  refers  to another class or a collection. This is a part of a whole relationship where  the  phase   cannot  implement  without  the  whole .  If  the  whole  is deleted then the parts are deleted.  For example:  An Order is a whole and the line items are the phase. If an order is removed then all the line items should be deleted as well.

Aggregations are not used to be circular.

In  a  garbage-collected  language  like  Java,  The  whole   has  the responsibility of  operating   the  garbage  collector  to  prematurely collect the part by holding reference to it.

Posted Date: 7/27/2012 5:30:44 AM | Location : United States







Related Discussions:- Difference between composition and aggregation, Assignment Help, Ask Question on Difference between composition and aggregation, Get Answer, Expert's Help, Difference between composition and aggregation Discussions

Write discussion on Difference between composition and aggregation
Your posts are moderated
Related Questions
What is Operator Overloading? A few object oriented languages, notably C++, permit you to not only overload techniques but also operators like + or -. This is very menaingful w

Application using Swing API

ActionForm is javabean which shows the form inputs containing the request parameters from the View referencing the Action bean.

Point-To-Point (PTP). This model permits exchanging messages via queues formed for some purposes. A client can send and receive messages from one or various queues. PTP model is ea

I have JavaScript work Project Description: I need an annonation type tool added It should be incredible simple for a good js coder. But there will be a custom design and

What do you understand by private, protected and public? These are accessibility modifiers. Private is the most restrictive, whereas public is the least restrictive. There is n

For this assignment, you will simulate a file system. You will be neither creating files nor reading or writing disk files. Rather, you will have a simulation of a file system that

What is bandwidth? In a general way Bandwidth is a capacity of communication channel of carrying data.

In programming, what is a loop? A loop is a programming language statement that permits your code to be repeatedly executed LOOP is a pedagogical programming language designed

Question Using 3 level of nested for loop, write a program that will produce the output as below.