Lecture
The complete implementation of the system under consideration is not overly large - only about 20 classes in all. Nevertheless, for any working piece of code a subsequent modernization stage is inevitable. Let us consider what would have to be done to implement two additional requirements for our system.
Clearly, the system makes it possible to measure many weather parameters, but not all of them. It may turn out that users also want to measure the amount of precipitation. What changes would then have to be made to the program?
Fortunately, we will not have to change our architecture radically; we will only need to extend it. Using as a basis the architectural blueprint presented in Figure 8-13, we can identify the following necessary changes:
We may encounter a number of further, smaller tasks involved in integrating the new class into the already existing architecture, but in any case neither the architecture itself nor the main mechanisms of the system will undergo serious changes.
Now let us consider an entirely different functional property: suppose we want to provide the ability to transmit the data collected during the day to a remote computer. To implement this task it is necessary to:
The mark of a well-thought-out object-oriented architecture is that changes do not destroy it but extend it, preserving the existing mechanisms.
Comments