XML

Designing a Distributed System

As we've seen, the design of a distributed system begins with the logical three-tier model. Initially, the overall goals of the system must be defined. These goals are broken down into the series of tasks the system must perform. These tasks are defined in UML use cases that define the interaction between the user and the system, and then the use cases can be used to define the user services components. A hotel's guest registration system could have the following use case:

  • Name Make a Reservation.
  • Overview The purpose of this use case is to create a new reservation.
  • Primary Actor The main actor is the Check-In Clerk.
  • Secondary Actors None.
  • Starting Point Request to enter a new reservation.
  • Ending Point The Guest is either assigned a reservation or the reservation is cancelled.
  • Measurable Result The Guest is either assigned a reservation or the guest is not assigned a reservation.
  • Flow of Events
    • Actor enters First and Last Name of Guest into the system.
    • Actor enters address of Guest into the system.
    • Actor enters room requirements for Guest.
    • Actor requests room reservation.
  • Use Case Extensions None.
  • Business Rules
    • Definition Business Rule Reservation
    • Definition Business Rule Guest
    • Definition Business Rule Check-In Clerk
  • Outstanding Issues None.

You can also use the use cases to create UML diagrams, such as a sequence diagram, to define the system's business and data services components. Figure 10-1 shows a sequence diagram illustrating the interaction between objects in the system and the interaction between the user and the system over time.

Figure 10-1. A sequence diagram for a hotel's guest registration system.

After the sequence diagrams have been completed, class diagrams are created, as shown in Figure 10-2. As you can see, class diagrams define the components of the system and the services they perform.

Figure 10-2. A class diagram for a hotel's guest registration system.

Up to this point in the design process, there should be little discussion of how these components will actually perform these services, in keeping with the concept of encapsulation. When you have reached this point, you must decide whether to buy, reuse, or build your components.