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

I have javascript work, I have JavaScript work Project Description: I...

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 is javaserver faces technology, A framework for building server-side u...

A framework for building server-side user interfaces for Web applications is written in the Java programming language.

I need ios native app developer, I want someone to help me prepare a simple...

I want someone to help me prepare a simple inventory system. I am not a programmer trying to learn as i go. Skills required: Android, Java, iPhone, Mobile Phone, Objective

Area under curves, Write a program to find the area under the curve y = f(x...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Explain the term - garbage collection, Explain the term - Garbage Collectio...

Explain the term - Garbage Collection Java  performs  garbage  collection  and  eliminates  the  need  to  free  objects  explicitly.  When an object  has  no references   to

Diffentiate local and global variables, Diffentiate Local and Global Variab...

Diffentiate Local and Global Variables? Local or function level variable effective just in the function in that they are declared although global variables visible everywhere o

I want hall rental website, I want Hall Rental Website Project Descripti...

I want Hall Rental Website Project Description: I want to prepare website for my party venue where i will post the photos and detail of place along with availability calendar

Java 2 micro edition - programming for mobile phones, You must design, code...

You must design, code and demonstrate a J2ME program (a program capable of running on mobile telephones) according to the specification given in the next section.  The overall cour

Javascript work, It could be something simple for a good js coder. But ther...

It could be something simple for a good js coder. But there may be a custom design and I can give more feedback for the person who is interested in working with me. Check Invisi

Please help, Write a program to find the area under the curve y = f(x) betw...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

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