5.3. Conversation Stereotypes and Scripts
Conversations can be described in several ways but it is most useful to describe a task using a conversation script. A script represents a stereotypical chunk of behaviour. It is an abstract textual description of such a conversation. As we will see, this provides a notion of generalized exception handling that does not seem to be available to users of the use case approach, where an exception (extends) path is often specific to the use case.
One word of warning is appropriate. This use of the term stereotype has absolutely nothing to do with the same word as used in UML; unfortunately there is no other sensible term for the idea that I want to capture here.
As an example, consider a script that describes the process of going to a restaurant. The idea is that one always does the same thing when visiting a restaurant. One always:
Enters the restaurant.
Attracts the attention of a waiter.
Takes one's seat.
Reads the menu.
Chooses a meal.
This is certainly a good stereotype of the situations normally met with.
Note how the script defines the notion of a restaurant. Suppose I were to tell you that, yesterday, I did the following.
Entered a building.
Attracted someone's attention.
Followed that person to a table.
Read the items on a list given to me.
Choose items from the list.
Consumed those items.
Left the building.
Firstly, I think you would be able to tell me what I was doing very easily indeed.
Secondly, notice that ...