This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes To use or not to use Association Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "To use or not to use Association Class" Watch "To use or not to use Association Class" New topic
Author

To use or not to use Association Class

Jeevan Sunkersett
Ranch Hand

Joined: Jul 03, 2007
Posts: 77
For part2 of the SCEA I am drawing the class diagram.

I am confused; when shud one use/ not-use an Association Class
when showing an asscociation between 2 classes.

Could some body provide a clear example (maybe code) to make it clear?

UML tools allow a line to be drawn between the classes
(with or without arrows; to indicate direction)
One end of the line can be diamond (filled for composition and unfilled for aggregations)

~g1
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

I don't explicity define the association class, but imply it through the association link in the class diagram. The actual object type used for the code becomes an low-level implementation detail that I could care less about.

-Cameron McKenzie
 
jQuery in Action, 3rd edition
 
subject: To use or not to use Association Class
 
It's not a secret anymore!