• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Objective ..

 
aravind arav
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Develop code that implements simple class associations, code that implements multiplicity using arrays, and recognize code that implements compositions as opposed to simple associations, and code that correctly implements association navigation."

Can anyone explain me this objective,especially the highlighted portion. What to study regarding this objective?
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> "Develop code that implements simple class associations

An example of two classes that are associated are a realty company and houses. The two exist independentally so they are only associated with each other.

An opposite of association is composition. A house is composed of its rooms.

> ... implement code that implements multiplicity using arrays.

For either associations or for compositions, there can be a one-to-many relationship. In both the examples of the association of a realty selling many houses and each house having many rooms, there is a one-to-many relationship.



the above code says that a Realty has as many as 75 houses for sale.



the above code says that each house can have as many as 15 rooms.

I haven't coded everything, but the relationship between a realty company and a house is an association because if the realty went out-of-business, the houses that it was trying to sell would still exist, but the relationship between a house and its rooms is a composition because if a house was torn down, the rooms that it was composed of would cease to exist.

You also need to know compositions and associations in UML notation:

UML Composition

UML Association & Navigation

Kaydell
[ June 13, 2007: Message edited by: Kaydell Leavitt ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic