The buffered producer/consumer system consists of five classes: Buffer, Producer, Product, Consumer, and System. The class System is the bootstrapper of the system, while the class Product models the products to be transfered from the producer to the consumer using the class Buffer. The Buffer has a determined capacity and the access to the buffer of producers and consumers must be synchronized via a synchronization protocol. The system is depicted in figure 28.
In this figure, one can see how the procurement annotations provide information about the instances of the participant classes, i.e. how they are generated and how they get visibility from each other. The system class is designated as the bootstrapper by the addition of a triangle on the left hand side of the icon class. It generates instances of the classes Producer, Buffer and Consumer. The outgoing arrow of the procurement annotation from the class Producer to the class Product means that ``Products'' are generated by ``Producer''.
The incoming arrows of the clientship relationship from the Consumer to the Product class means that Consumer imports references to the ``Products'' objects generated by ``Producer'' objects. Similarly, the incoming arrows of the clientship relationship from the Producer and Consumer class to the Buffer class indicates that both import references to instance of this class. In the same way, the Buffer class imports references to ``Product'' objects.
|
|