Home arrow Practices arrow Page 2 - Classes

Discovering Classes - Practices

In this article you will learn about the Unified Modeling Language (UML) by examining basic modeling of things and concepts in the real world. It is excerpted from the book Fast Track UML 2.0, written by Kendall Scott (Apress, 2004; ISBN: 1590593200)

TABLE OF CONTENTS:
  1. Classes
  2. Discovering Classes
  3. Attribute and Operation Details
  4. Abstract Classes
  5. Internal Class Structure
  6. Other Stereotypes on Classes
By: Apress Publishing
Rating: starstarstarstarstar / 11
April 27, 2005

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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
 

blog comments powered by Disqus
   

PRACTICES ARTICLES

- Calculating Development Project Costs
- 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

Developer Shed Affiliates

 



© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap

Dev Shed Tutorial Topics: