Solutions: Exercise 3

Find the Objects, Object Relations and Operations

Remember: The solutions below are only suggested solutions.

Coffee Machine

The image below shows a possible set of objects and object relations.

Click on the picture to see the behaviour of the Control Unit software
If this does not work, click here to get help

A few things can be noted about this design:

These are two examples of encapsulation and the distributed allocation of responsibilities, and how it helps to reduce complexity. Objects signal WHAT is to be done, instead of getting involved in HOW it is to be performed.

The fact that the HOW is hidden behind a simple interface, makes the system more easily modifiable. "Behind the scenes" we may modify the structure of data stored, and the code performing the operation.

Another thing about this design is that the model is not structured around to the ordering of events. The objects don't care about WHY or at WHAT TIME another object requests an operation -- they just do what they are told, quite unaffected by the current state of the coffee machine.

This too helps to make the system more easily modifiable.

If you are an experienced software developer, you probably realize that the design principles illustrated above are not new or unique. This is true -- object-orientation is to a large extent based on "good design principles" formed by many years of experience and research in software engineering.

What is "new" is that there are programming languages, methods and other tools to support and enforce some of these design principles.


previous | next | start | contents | dictionary | help | evaluation

© Ericsson Telecom AB, 1995, Stockholm, Sweden