Difference between composition and aggregation, JAVA Programming

Assignment Help:

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.


Related Discussions:- Difference between composition and aggregation

Write code in javascript to display the odd numbers, Write code in JavaScri...

Write code in JavaScript to display the odd numbers among 20 to 100 using FOR statement? Note: No required to write whole HTML program. Just JavaScript code of require elemen

Java, 1. Which of the following are not valid Java identifiers, and why? (...

1. Which of the following are not valid Java identifiers, and why? (a) wolVes (b) United(there is only one) (c) 87 (d) 5 3 (e) Real ale (f) isFound?by 2. A class Television

What is jms message, An object that having the data being transferred among...

An object that having the data being transferred among JMS clients.

Probability, Mike sells on the average 15 newspapers per week (Monday – Fri...

Mike sells on the average 15 newspapers per week (Monday – Friday). Find the probability that 2.1 In a given week he will sell all the newspapers [7] 2.2 In a given day he will se

Inheritance, Draw an inheritance hierarchy to represent a shoe object. The...

Draw an inheritance hierarchy to represent a shoe object. The base class should have derived classes of Dress Shoes, Tennis Shoes and Boots.

What are synchronized methods and synchronized statements, What are synchro...

What are synchronized methods and synchronized statements? Synchronized methods are methods that are used to control access to an object. A thread only implements a synchronize

MATLAB, Requested figure handle in use by another object, how do i fix this...

Requested figure handle in use by another object, how do i fix this?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd