Practices
  Home arrow Practices arrow Page 5 - Class Relationships
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PRACTICES

Class Relationships
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 9
    2005-06-16

    Table of Contents:
  • Class Relationships
  • Aggregation
  • Generalization
  • Dependencies
  • Association Classes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Class Relationships - Association Classes


    (Page 5 of 5 )

    An association class is a cross between an association (see the section “Associations,” earlier in this chapter) and a class (see Chapter 1).

    You use an association class to model an association that has interesting characteristics of its own outside of the classes it connects. This construct also comes in handy when you have a many-to-many relationship that you’d like to break into a set of one-to-many relationships (as discussed in the section “Discovering Classes” in Chapter 1).

    An association class itself appears as a regular class box. You indicate that it’s an association class by connecting it to the association between the other two classes using a dashed line.

    Figure 2-27 shows an example of an association class that was introduced in Chapter 1.


    Figure 2-27Association class

    There would normally be a many-to-many relationship between Author and Book, because an Author may have written more than one Book and a Book may have more than one Author. The presence of the BookAndAuthor association class allows the pairing of one Author with one Book; the role attribute provides the option of stating whether the Author was the primary author, supporting author, or editor, for example.

    Refer to the «enumeration» stereotype in the section “Other Stereotypes on Classes” in Chapter 1 for a discussion of an alternate way to model the role attribute. One of the most useful things about the UML is that it often offers various options for modeling a particular idea. Of course, this can also be a curse, but in general, it’s the opinion of this author that having options is a good thing.

    Looking Ahead

    In the next chapter, you look at the UML diagrams that show combinations of classes and the relationships among them.


    1 Ed Roman, Mastering Enterprise JavaBeans (Second Edition) (New York, NY: John Wiley & Sons, 2001).


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    Buy this book now. This article is taken from Fast Track UML 2.0 written by Kendall Scott (Apress, 2004; ISBN: 1590593200). Check it out at your favorite bookstore. Buy this book now.

       

    PRACTICES ARTICLES

    - Finishing the System`s Outlines
    - The System in So Many Words
    - Basic Data Types and Calculations
    - What`s the Address? Pointers
    - Design with ArgoUML
    - Pragmatic Guidelines: Diagrams That Work
    - Five-Step UML: OOAD for Short Attention Span...
    - Five-Step UML: OOAD for Short Attention Span...
    - Introducing UML: Object-Oriented Analysis an...
    - Class and Object Diagrams
    - Class Relationships
    - Classes
    - Basic Ideas
    - Choosing the Right Team
    - Trees





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway