What’s difference between Association, Aggregation and
Inheritance relationships?
Answers were Sorted based on User's Feedback
Answer / purusoth
Class hierarchies (Inheritance and aggregation)
What is difference between Association, Aggregation and
Inheritance relationships?
In object oriented world objects have relation and
hierarchies in between them. There are
basically three kind of relationship in Object Oriented
world :-
Association
This is the simplest relationship between objects. Example
every customer has sales. So
Customer object and sales object have an association
relation between them.
Aggregation
This is also called as composition model. Example in order
to make a “Accounts” class it
has use other objects example “Voucher”, “Journal”
and “Cash” objects. So accounts
class is aggregation of these three objects.
Inheritance
Hierarchy is used to define more specialized classes based
on a preexisting generalized
class. Example we have VEHICLE class and we can inherit
this class make more
specialized class like CAR, which will add new attributes
and use some existing qualities
of the parent class. Its shows more of a parent-child
relationship. This kind of hierarchy
is called inheritance.
| Is This Answer Correct ? | 26 Yes | 4 No |
Answer / meenakshi sharma
Association- Association is used for establishing
relationship between classes. Association describes links
between(among) classes. For example, if a professor works
in a university then it can be represent as the assciation
relationship between professor and university class.
Aggregation-Aggregation is a concept that is used to
express "part-of" types of associations between
objects.Aggregation is seen as a relationship in which an
assembly class is related to component class. In this
component objects are not having seperate existence, they
depend on composite objects.
Inheritance-Inheritance is an object orientation concept
which allow reusability of design/code. Basic meaning of
inheritance is that if one class is already defined than
another class which also passes the property of existing
class can be defined and inherit the property of existing
class. For example, if a class named Student is defined and
another class for Post Graduate students is to be defined
then PG Student class can inherit the Student class.
| Is This Answer Correct ? | 13 Yes | 0 No |
What is private readonly in c#?
What is array formula?
Define strong name in c#?
What does question mark mean in c#?
What is a hash table in c#?
Overloaded constructor will call default constructor internally?
Is null == null c#?
What is variable in c#?
What is xml serialization in c#?
what is master pages how to use it. plase give one example in code vice
Is c# a backend language?
What are extender provider components?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)