GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  J2EE  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 15 of 30    Print  
What is aggregation and composition of objects?
What is the diff between monolithic and composite object?

  
Total Answers and Comments: 2 Last Update: September 14, 2006     Asked by: din 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: rajagobals
 

Aggregation differs from ordinary composition in that it does not imply ownership. In composition, when the owning object is destroyed, so are the contained objects. In aggregation, this is not necessarily true.

For example, a university owns various departments (e.g., chemistry) , and each department has a number of professors. If the university closes, the departments will no longer exist, but the professors in those departments will. Therefore, a University can be seen as a composition of departments, whereas departments have an aggregation of professors.



Above answer was rated as good by the following members:
phdsong
April 05, 2006 08:46:25   #1  
pranabj Member Since: April 2006   Contribution: 1    

RE: What is aggregation and composition of objects?

Suppose, you have a class named UserInformation . And with that class you are having a object instance named UserContactInfo

Class UserInformation {

UserContactInfo userContactInfo ;

}

This leads to aggregation. The UserContactInfo object is aggreated within UserInformation class. Both the classes have individual identity.

Now , suppose we have a class named Rectangle . And within that class you have Class Point as a object.

Class Rectangle {

Point point ;

}

Now , rectangle is a composition of points. Point class doesn't have any individual important . It is point that makes a rectangle . This is known as composition.

Hope it makes clear.


 
Is this answer useful? Yes | No
September 14, 2006 16:20:47   #2  
rajagobals Member Since: September 2006   Contribution: 1    

RE: What is aggregation and composition of objects?

Aggregation differs from ordinary composition in that it does not imply ownership. In composition, when the owning object is destroyed, so are the contained objects. In aggregation, this is not necessarily true.

For example, a university owns various departments (e.g., chemistry) , and each department has a number of professors. If the university closes, the departments will no longer exist, but the professors in those departments will. Therefore, a University can be seen as a composition of departments, whereas departments have an aggregation of professors.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

Latest Answer : Actully this is an attribute of this page, and this particular page will be displayed when the other page( say page 2) got some error, provided, where the errorpage attribute  has to de set to this page. put it in a nut shell, this shows that ...
Read Answers (2) | Asked by : Naresh

Can I restrict the users of my class(say class A) to create an instance of my class not more than once(only one), and if anybody tries to create more than one instance, all the object refernces should refer to the same (one) instance
Read Answers (7) | Asked by : waseem

Latest Answer : in java there is no concept of static object ...
Read Answers (6) | Asked by : ap_rams

Latest Answer : The class whose all methods have body is called as conceetclass Yes object class is concreet class ...
Read Answers (6) | Asked by : vishal

Latest Answer : Union dosent allow duplicate valueUnion all allows duplicate value ...
Read Answers (3) | Asked by : SUNDARAMOORTHYS

What is aggregation and composition of objects?What is the diff between monolithic and composite object?
Read Answers (2) | Asked by : din

Which one of the following describes the OO concept of Aggregation? 1.A system of objects that implement each other 2.A system of objects that are built using each other 3.A system of objects that define each other 4.A system of objects that are not related 5.A system of objects inherited from each other
Read Answers (5) | Asked by : Sateesh

Serializable is used to read or write the object and find the state of an object. What is the use of finding the state of an object, Explain with an example?


 Sponsored Links

 
Related Articles

ODP.NET - OracleCommand Object

ODP NET More About the OracleCommand Object Till now we have seen OracleCommand working with OracleDataReader OracleCommand is not simply meant for OracleDataReader It has got a lot of functionality for itself Let us see few of the most commonly used features of OracleCommand in this section We will
 

Microsoft AJAX Library - Creating Object Members on the Fly

Creating Object Members on the Fly One major difference between OOP in C and ASP NET and OOP in JavaScript is that JavaScript allows creating object members on the fly" This is true for objects and classes that you create yourself and also for JavaScript s own objects and types as well He
 

Microsoft AJAX Library - Object-Oriented JavaScript

Object Oriented JavaScript Objects and classes are implemented differently in JavaScript than in languages such as C VB NET Java or C However when it comes to using them you ll feel on familiar ground You create objects using the new operator and you call their methods or access their fields using t
 

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

OOPS Tutorials

Object oriented programming OOP is a computer science term used to characterize a programming language that began development in the 1960’ s The term object oriented programming’ was originally coined by Xerox PARC to designate a computer application that describes the methodol
 

Object-Oriented Client-Server Internet

Object Oriented Client Server Internet OCSI Environments as IT Infrastructure Client Server Basics Object Oriented Client Server Internet OCSI environments provide the IT infrastructure for supporting OCSI applications For our purposes infrastructure refers to operating systems networks middleware
 

C++ Objects and Classes

C Objects and Classes An Overview about Objects and Classes In object oriented programming language C the data and functions procedures to manipulate the data are bundled together as a self contained unit called an object A class is an extended concept similar to that of structure in C programming l
 

JavaScript Objects

JavaScript Objects Object oriented Programming in an important aspect of JavaScript It is possible to use built in objects available in JavaScript It is also possible for a JavaScript programmer to define his own objects and variable types In this JavaScript tutorial you will learn how to make use
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 

JavaScript Date Object

JavaScript Date Object In this JavaScript tutorial you will learn about date object and methods of date object explained along with syntax and example mosgoogle center JavaScript Date Object Usage of Date Object Date object of Java Script is used to work with date and times General syntax for defini
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape