Home arrow Practices arrow Page 4 - The System in So Many Words

What's in a Name? - Practices

This article will show you how to talk to a client so that you are both on the same page when designing a system and understanding what it will be required to do. It is excerpted from Prefactoring,  Written by Ken Pugh (O'Reilly; ISBN: 596008740). Copyright 2007 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

TABLE OF CONTENTS:
  1. The System in So Many Words
  2. Sam's Use Cases
  3. The Ilities
  4. What's in a Name?
  5. Splitters Versus Lumpers
By: O'Reilly Media
Rating: starstarstarstarstar / 2
May 15, 2008

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
 

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
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

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

 


Dev Shed Tutorial Topics: