Example

With this example, it is easier to understand, how the Display works. It contains an UML collaboration diagram.

In this diagram the The FET pattern: data source, data gate, data drain is used. For a better understanding, see the Section called The FET pattern: data source, data gate, data drain in Chapter 9

Example: UML Collaboration Diagram

Figure 5-14. Example: UML Collaboration Diagram

Example: UML Collaboration Diagram

Example: Description

During the initialization phase, instances of the Command_Factory, the Dialog_Factory, and the Preset Parameter Pot (PPP) are created. Additionally, associations between the Dialog_Factory Instances and the corresponding Preset Parameter Pot (PPP) Instances are created and also associations between the Command_Factory Instances and the corresponding Dialog_Factory Instances.

First, the Command_Factory receives a request for a Command.

  1. The Command_Factory asks the associated Dialog_Factory for a Dialog_Data_Source.

    1. The Dialog_Factory creates a new Dialog.

    2. It links the Preset Parameter Pot (PPP) as a Data Source to the new Dialog.

    3. It creates a new Dialog_Data_Source by giving the Dialog as a parameter.

      The Dialog_Data_Source is a concrete implementation of a Data Source. Therefore it knows the components of the Dialog and how to put the values of them into a Preset Parameter Pot (PPP).

  2. The Command_Factory asks the Dialog_Factory for the associated Preset Parameter Pot (PPP).

  3. The Command_Factory creates a new Data_Gate.

  4. It links the Dialog_Data_source to the Data_Gate.

  5. Then it adds the Preset Parameter Pot (PPP) as a Data Drain to the new Data_Gate.

  6. The Command_Factory creates the requested Command.

  7. It passes the Data_Gate to the Command.

    The Command internally adds a Command Parameter Pot (CPP) as a Data Drain (DD). This is important for the execution of a Command, see Controller (Chapter 6).

When the Collect_Data Segment of the Command Pipeline is reached (see The Parts of the Command Pipeline, the Section called The Parts of the Command Pipeline in Chapter 6), the Commands sends the Data Gate a distribute message. The Data Gate asks the Data Source, i.e. the Dialog, for its Data. Large dialogs will have a controller additionally to manage the dialog interactions. The Dialog gets its presets from the Preset Parameter Pot (PPP). After the user has finished her input, the Data Gate distributes the user input from the Dialog to the Command.