Interface IWeather

The behavior of interface IWeather is defined based on the role classes that implement this interface play in the system. The Weather class should provide weather data to all other objects in the system that need them. Different sources of weather data can be used; one source could be a text file saved locally in the system and another source could be a network of weather stations that can be accessed on-line. The behavior IWeather interface should define is shown in Figure 8-32.

IWeather has a few particularities that make this interface different from other already defined interfaces. All the defined methods are used in the simulation process. There are no methods used to set relationships with other objects as objects of type Weather, according to the conceptual diagram, do not have access to other objects of the system. They only provide weather data to all other objects that will request these data.

1 import java.util.Iterator;

2 import java.util.Properties;

0 0

Post a comment