Interface ISoil

The behavior of interface ISoil is defined based on the role classes that implement this interface play in the system. In the case of the class Soil, its interface should define all the functions that module Soil must provide as defined by [Kra95]. As mentioned in the beginning of this chapter, module Soil should be able to read its own initial data, and perform the processes referred to as initialization, rate calculation, and integration. Objects created from class Soil should be able to communicate with objects created from class Plant, to obtain from them the plant data required for calculating processes occurring in soil and to establish relationships with other objects in the system. The relationships between objects are already defined in the class diagram presented in Section 7. Figure 8-30 shows the Java code for interface ISoil.

As shown in Figure 8-30, there are two stereotypes defined for interface ISoil: One referred to as used by the simulator controller and the other referred to as used to set relationships with other classes. The methods belonging to the first stereotype are used in the simulation process and the methods belonging to the second stereotype allow an object of type Soil to set relationships with objects of type Plant and Weather.

1 import java.util.Properties;

0 0

Post a comment