Table 5.9 Test program file
None: is the number of instructions to read
Insert first number:
Insert second number:
Modelling techniques . In this case study we introduced the notation of
state charts, that are used to describe finite state automata.
Development approach . During development we faced two features of the
system separately: first, the structural representation of computer archi-
tectures; second, the behaviour of the components and in particular of the CPU.
The finite state automata are a well-defined formalism that describe a
state-based behaviour. FSA can be translated into Java code that imple-
ments the required behaviour (see Sidebar 5.2).
Aggregation associations can be used to express a strong part
tionship between classes. Transferring most of the aggregation semantics
into the code results in better traceability and improved readability of the
code. The aggregate association idiom can be used to implement aggregation
associations in the most expressive way.
When a constant value is used in several places, either in a single class or
in multiple classes, there are problems of consistency and ease of update.
These issues, among others, are addressed by the constant member idiom.
An aggregation association between two classes.
How to implement the association preserving the semantics of aggregation
and maximizing readability and ease of use.
Forces or tradeoffs
It must be navigable. The aggregation link remains unchanged for the
entire lifetime of the container. The syntax must be readable. It is easy to
forget to instantiate the components.