Java Reference
In-Depth Information
Control flow models
We identify three types of control flow models.
1 Single-threaded . This is the basic model where no concurrency is
present; at any time there is only one instruction that is being executed.
Only one component at a time is active and it has to yield control to other
components (usually by method invocation).
2 Virtual processes . This is based on a single threaded model but gives the
appearance of concurrent execution. In this approach a controller com-
ponent schedules the execution of the other components and gives them
control. The scheduling can be performed periodically or based on events.
The components whose execution is scheduled are responsible for
performing the scheduled activity and returning the control back to the
controller. This model is based on a logical decomposition of activities in
simple steps whose execution requires only short intervals of time. The
programmer has the responsibility of decomposing the components'
activities according to the application requirements.
3 Multithreaded . This approach allows real concurrency; it is based on the
concurrency mechanisms of the operating system. Several threads can be
running at the same time in an application. Even in this case, only one
component has control over the application execution. In contrast to the
virtual processes approach, the decomposition of components' activities
in simple steps is performed by the operating system at a lower granu-
larity. The main disadvantage is that the threads management raises the
computational load.
Part overview
The second part of this topic is organized in four case studies. They
present object architectures that implement different architectural styles,
communication mechanisms and concurrency models. The case studies use
different methods to synthesize generic components (see Table 7.1).
The case study presented in Chapter 8 (Code documentation) deals with
the development of a graphical application that parses a source Java code
Table 7.1 Architectures adopted in the case studies
Case study
8 Code documentation
Method invocation
9 Work cell
Virtual machine
Virtual processes
10 Mobile robot
11 Car Parking
Method invocation and
Search WWH ::

Custom Search