javablogspot

Just another WordPress.com weblog

Java Term of the Week: Aggregation

Posted by damuchinni on February 15, 2009

In the past month or so there have been a few articles on the “is-a” relationship between classes, better known as inheritance. This week’s Java term is another class relationship, the “has-a” or aggregation relationship. Imagine a Student class that stores information about individual students at a school. Now let’s say there is a Subject class that holds the details about a particular subject (e.g., history, geography). If the Student class is defined to contain a Subject object then the relationship between the two classes is the aggregation relationship. It can be said that a Student object has-a Subject object.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: