Software enginering, autumn 2002,Exercise 6

 

Bottle recycling machine receives bottles from customers, recognizes them, delivers them in proper containers and computes the compensation. When the customer has no more bottles to insert he requests the payment by pressing the 'pay' button. Before paying the machine writes a receipt and registers the payment and the bottles in its internal files. The machine informs its oprator about fatal errors whith a sound alarm that last until the operator turns if off. Customers are informed about their errors with a brief sound and a message on the screen. The operator may add new bottle types and criteria for their recognition. He may also define and modify bottle type specific compensations. Occasionally he adds coins in the cash and prints statistics of the use of the machine.

The machine consists of a bottle recognition unit, conveyer, counter, alarm unit, pay button, cash, bottle containers, and receipt printer.

1-2 Outline the specification of the system as a data flow diagram (at most 3 levels)

3-4 Outline an object oriented specification of the software needed. Which of these two techniques suits better for this problem?

5 In a layered architecture, the objects (modules) of the upper layer usually call the methods of the lower layer. The lower layer is implemented before the upper one. Sometimes it is, however, necessary for the objects of the lower layer to call methods that belong to the upper layer. This is called callback. Find out how this can be done in Java. Work up a small example.


Harri Laine, 16.10.2002