Practices
  Home arrow Practices arrow Page 2 - Classes
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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? 
Google.com  
PRACTICES

Classes
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 9
    2005-04-27


    Table of Contents:
  • Classes
  • Discovering Classes
  • Attribute and Operation Details
  • Abstract Classes
  • Internal Class Structure
  • Other Stereotypes on Classes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    Classes - Discovering Classes
    ( Page 2 of 6 )

    A simple yet effective way to discover classes uses a technique variously known as noun/verb analysis and grammatical inspection. This involves poring through high-level requirements documents, marketing materials, and other materials that provide insight into the problem domain (in other words, the arena defined by the problem that the new system is supposed to solve). See Use Case Driven Object Modeling with UML4 for an example of how to perform grammatical inspection using a set of text requirements.

    Many people use rapid prototyping as a device for exploring requirements with users. Let’s see how we might use a prototype HTML page for an Internet bookstore to discover a small subset of the classes we’ll need in modeling the bookstore as a whole. We start with a page that displays the details of a particular book.  

    A quick mental review of the page reveals the following obvious candidates for classes:

    • There’s a Book, of course, and at least one Author.

    • There’s a Publisher.

    • There may be one or more Reviews of the Book. These Reviews fall into one of two categories: EditorialReviews and CustomerReviews. (You see how to make this distinction in Chapter 2.) Each Review has a Reviewer associated with it.

    If we move ahead and envision the viewer of this page purchasing the Book, the following other potential classes come into view:

    • The viewer becomes a Customer, with an associated Account.

    • The Book becomes part of an Order.

    • The Order has to have BillingInformation and ShippingInformation in order for the bookstore to get paid and to ship the book.

    Analyzing a little more deeply reveals the need for the following two other classes:

    • A Book can have more than one Author, as I’ve noted, but an Author can have more than one Book, too. In the interest of avoiding many-to-many relationships, we need a BookAndAuthor class. (You see how to represent this class in Chapter 2.)
    • The bookstore uses various shipping companies, so there needs to be a Shipper class.

      The result, then, is the following set of nouns and noun phrases:
    • Account

    • Author

    • BillingInfo

    • Book

    • BookAndAuthor
    • Customer

    • CustomerReview

    • EditorialReview

    • Order

    • Publisher

    • Review

    • Reviewer

    • Shipper

    • ShippingInfo

    NOTE This example is representative of a fundamentally sound idea: Find as many nouns and noun phrases as possible to start, and only analyze, refine, and expand the list later. Regardless of how you go about it, though, discovering classes is an excellent way to get your modeling off to a good start.



     
     
    >>> More Practices Articles          >>> More By Apress Publishing
     

       

    PRACTICES ARTICLES

    - More Techniques for Finding Things
    - Finding Things
    - 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





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek