10.1. The Catalog Search Use Case

 <  Day Day Up  >  

My phone rang. I picked it up. Sam started talking immediately.

"Hello. I think I'd really like to get the in-store catalog in operation. Some of the customers have been asking for it. The printed listing of what CDDiscs we have in inventory works OK, but they'd like to be able to search for which CDDiscs have a particular song."

"Sounds fine. Let's get together and discuss the details," I suggested.

"I don't have much time, but I don't want to hold you up. I'm heading to the Caribbean in half an hour ," Sam said in a hurried tone.

"All right. We need to work on the details," I replied.

"No time for details. I just want it searchable," he said.

"OK, I'll start to work on it. Can I get in contact with you if I have a question?" I asked.

"No. We'll be on a remote island without phones. But I trust you'll do the right thing," he replied.

"I'll tell you what; can I create a simple use case description and have you approve it before you go?" I queried.

"Yeah, go ahead, but make it quick. My taxi leaves in half an hour," he stated.

"Can I go with you?" I asked. "I hate to work on a project without the client available."

"Maybe some other time. I trust you'll make the right decisions," he replied.

I expanded the original Search_catalog use case to multiple use cases. This is an example of a hierarchical set of use cases. Search_catalog is at the top, and the following use cases fall underneath, each providing a detailed manifestation of the original use case:



Search_for_song

  1. User enters a string.

  2. System responds with all song titles that match that string.

  3. User selects one song title.

  4. System responds with all CDReleases that contain that song.

  5. User selects one CDRelease.

  6. User either exits or performs a Search_for_availability.



Search_for_availability extends Search_for_Song

  1. User has selected a CDRelease.

  2. If a corresponding CDDisc is available, system informs user of availability.

  3. Otherwise, system responds that all CDDiscs of the CDRelease are currently rented.

Now, one could imagine that later on, Sam might suggest using a sound-alike match or a wildcard format so that the user does not have to specify a name or title exactly. Such approaches are variations of the Search_for_song use case. In abstract terms, they are exactly the same use case, varying only by the definition of match , which could be any of the following: match exactly, match by sound-alike, or match with wildcards.

Do we need more detail for the Search_for_song use case? It contains some implicit requirements. There is an assumption that the system responds in a reasonable amount of time. If it takes 10 minutes to do a search, the system will be useless. It probably does not matter if it takes one one-hundredth of a second or one-tenth of a second. The user probably would not perceive that small a difference. However, there is a time period in the range of one-tenth of a second through 10 minutes for which the performance is not acceptable. The use case flow does not indicate this time period. That value should be captured in documentation accompanying the use case.

I emailed a copy of the preceding use cases to Sam. He sent back a third use case:



Search_by_performer

  1. User inputs a string.

  2. System responds with all performers that match that string.

  3. User selects one performer.

  4. System responds with all CDReleases by that performer.

  5. User either exits or performs a Search_for_availability.

I called up Sam to see if he wanted one more search, which seemed to complete the group : Search_for_CD_title.

He was rushing out the door. "Well, I hadn't thought of that, but it seems like a good idea," he said. "Go for it."

I wrote up the last use case:



Search_for_CD_title

  1. User enters a string.

  2. System responds with all CDReleases whose title matches that string.

  3. User selects one.

  4. User either exits or performs a Search_for_availability.

 <  Day Day Up  >  


Prefactoring
Prefactoring: Extreme Abstraction, Extreme Separation, Extreme Readability
ISBN: 0596008740
EAN: 2147483647
Year: 2005
Pages: 175
Authors: Ken Pugh

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net