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

What is an abstract class in java, Question: (a) Java does not support ...

Question: (a) Java does not support multiple inheritance but does provide the concept of ‘interface'. Explain how interfaces can help a programmer to implement multiple inheri

Data structure, consider the file name cars.text each line in the file cont...

consider the file name cars.text each line in the file contains information about a car ( year,company,manufacture,model name,type) 1-read the file 2-add each car which is represen

What is the role of the jms provider, The JMS provider handles security of ...

The JMS provider handles security of the messages, data conversion and the client triggering. The JMS provider verifies the level of encryption and the security level of the messag

The tic-tac-toe program, Instructions Modify the program so that the co...

Instructions Modify the program so that the computer will generate moves for the ‘O' player (it must continue to accept user input for ‘X'). A simple way to do this is to use a

Retrieving data from Excel file , how to retrieve data from Excel file, and...

how to retrieve data from Excel file, and display that data in table on jsp page?

Java program to play minesweeper , Project Requirements Write and tes...

Project Requirements Write and test a Java program to play Minesweeper using Model-View-Presenter design (The model is an interface defining the data to be displayed or other

Define the difference between stringbuffer and string class, Define the dif...

Define the difference between StringBuffer and String class ?

Object and Instance, What is the difference between instance and object of ...

What is the difference between instance and object of a class? Few says both are same, then why java kept both the words for same thing?

Write names of the dos attacks phases, Write names of the DoS attack's phas...

Write names of the DoS attack's phases? DoS (Denail of service): DoS attach has in total 3 kinds of phases and below they are listed: 1. Search 2. Arm 3. Attack

Develop android geolocation service app, Project Description: Develop an...

Project Description: Develop an android service app that will run on the background. The app has to get the users location (longitude and latitude) every 5 minutes or when th

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