Chapter 6: Sample Requirements and Design

 < Day Day Up > 



In this chapter, we introduce our redbook sample application, and describe its objectives. We define the requirements and explain our design decisions.

6.1 Sample application requirements

In this section we introduce the sample application and describe its features.

6.1.1 The application

The problem space we have chosen to demonstrate model construction is workflow. It has a few key concepts that should be interesting to our readers, and is general enough so that all our readers should understand these concepts.

A workflow is a collection of tasks. Two types of task have been defined: simple and complex.

Simple tasks

A simple task, as represented in Figure 6-1, has one input, one output, and one fault output. A simple task does some sort of processing on the data given to it. Two tasks are linked together with an edge. Data on the input is processed by the task and made available on the output.


Figure 6-1: Task representation

Complex tasks

These are the complex tasks that we use in our sample application:

  • Compound task: A compound task is a kind of container. It follows the composite pattern. It contains a containment reference to a workflow, which can contain other simple or compound tasks.

  • Loop task: The loop task gives us the ability to iterate, as long the condition, a predicate, is true.

  • Choice task: The choice task implements branching.

  • Transformation: Transformation has been introduced in order to enable a task to do a combination of its multiple inputs.

Figure 6-2 shows the representation we use for complex tasks.

click to expand
Figure 6-2: Complex task representation

Edge

An edge is used to link two tasks together. The output of the first task is redirected to the input of the second task. An edge represents both control and data flow. This means that once the first task has completed, the data made available to and the control flow is transferred to the second task.

Multiple edges can end to a task input slot. This means that the task has to wait for all former tasks to reach the completion stage, before being able to process the multiple data set available.

Figure 6-3 shows our representation of edges.


Figure 6-3: Concurrency and edge representation

Variables and labels

The final two concepts that we introduce are the use of labels and the use of variables. Labels can be used to decorate any of the input, output, and fault slots of a task, to decorate conditions on a conditional edge from a conditional task, and to decorate variables.

Variables are used to store data, usually coming from the output of a task, and to hold the data until another task in the workflow makes use of it. Variables can be seen as a way to separate the control flow from the data flow. Control goes to the next task, while the data is held in the variable.

Start and end tasks

In order to run the workflow, we define a start and end point as a decoration of a task. The start icon is a green triangle, while the stop icon is a small red square. See Figure 6-4 for an example.

click to expand
Figure 6-4: Data flow, variable, start, and stop tasks representation



 < Day Day Up > 



Eclipse Development using the Graphical Editing Framework and the Eclipse Modeling Framework
Eclipse Development Using the Graphical Editing Framework And the Eclipse Modeling Framework
ISBN: 0738453161
EAN: 2147483647
Year: 2004
Pages: 70
Authors: IBM Redbooks

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