Practices
  Home arrow Practices arrow Page 4 - The System in So Many Words
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 
Moblin 
JMSL Numerical Library 
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

The System in So Many Words
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-05-15

    Table of Contents:
  • The System in So Many Words
  • Sam's Use Cases
  • The Ilities
  • What's in a Name?
  • Splitters Versus Lumpers

  • 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


    The System in So Many Words - What's in a Name?


    (Page 4 of 5 )

     

    Names are important, not just for the code but also for requirements and analysis. If you don't know what you're talking about, it's hard to design for it.

    Sam described how he wants to keep track of the CDs. He also desired a catalog of all the CDs that he has for rent.

    "So, what is a CD?" I asked Sam.

    He paused for a moment and looked at me with a questioning expression on his face. He must have thought I was crazy. "You know, one of those round things you put in a CD player," he said.

    "So, when you said you want a CD catalog, do you mean you want an entry in it for every round thing you have in your store?" I asked.

    He paused again. "No, I want only one for each title, regardless of how many copies I have in the store."

    I suggested, "So, let's decide to use two terms, one for the CD title and one for the CD copy. This way we minimize the opportunity for misunderstanding. What do you want to call each thing?"

    "Now I see what you mean," he replied. "What do you suggest?"

    I replied, "Let's call the title a CDRelease, and the other a CDDisc. We could use the name CDTitle, but that would start to get confusing when we talk about the title of a CDTitle. To clarify what we mean even further, we can describe each term with a sentence:

    A CDRelease is a CD identified by its Universal Product Code (UPC).

    A CDDisc is a physical copy of a CDRelease. CDDiscs, not CDReleases, are what are rented.

    "Now is it possible that a CD which a customer would be looking for would be related to two different UPCs?" I asked.

    "It's possible," he said. But I don't think we need to worry about that. One would usually have the term rerelease in its title."

    "We can always revisit this question if things change," I said. "Let's alter your requirements and the use cases to utilize these terms."

    At this point, Sam and I came up with the following list of modified requirements:

    1. Keep track of where each CDDisc is, both when it is in the store and when someone has rented it (including who has rented it).
    2. Report when a CDDisc is overdue.
    3. Have a catalog so that customers can see which CDReleases are stocked, what songs are on each CDRelease, and which corresponding CDDiscs are available in the store.

    Here is a modified use case:

    Checkout_a_CDDisc

    a . The user enters the customer ID and the CDDisc ID into the system.

    b. The system records the entry. It responds by printing a rental contract for the customer to sign.

    Names are subjective. As long as you and the client agree on a name, it does not matter if the name makes sense to the outside world. Here are some other possibilities for names of these two concepts:

    CDUPC
      
    A CD identified by a UPC

    CDPhysical
      
    A physical CD of a particular CDUPC

    CDCatalogItem
      
    A CD identified by a UPC

    CDRentalItem
      
    A physical CD copy of a particular CDCatalogItem

    Attributes of these classes should use the same names as the customer uses. If the customer uses a full name, avoid making up an abbreviation for it. If the customer uses an abbreviation or acronym, use that. If you have a hard time recalling what the short form means, ask the customer to supply a longer name.

    A ROSE BY ANY OTHER NAME IS NOT A ROSE

    Create a clearly defined name for each concept in a system.*

    More Practices Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Prefactoring," published by O'Reilly. We...
     

    Buy this book now. This article is excerpted from Prefactoring, written by Ken Pugh (O'Reilly; ISBN: 596008740). Check it out today at your favorite bookstore. Buy this book now.

       

    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-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway