Integrating smart devices in Java applications

class. The reason that the AbstractProgrammableDevice and AbstractDataExchangeDevice are abstract classes is that it doesn’t make any sense to instantiate them directly, but the developer should be forced to use the corresponding interface or to inherit behavior from the abstract classes. Additionally this package encapsulates the SmartDeviceListener and SmartDeviceEvent class. Both classes are implemented to allow sending of events if anything in a smart device changes. Using SmartDeviceListener interface allows to register listeners for smart device events according to the Java event model. More classes that are implement in this package are the Usecase and the Action class which are both for the encapsulation of a certain task which should be solved by the device or in which the device should be used. Furthermore is the Program and the SourceCode class implemented within the core package, both are used to allow the organization of programs, which might be given as source code, of a programmable device. 4.2.2 The devices package Within this package concrete devices are encapsulated. Those devices extend the ProgrammableDevice or the DataExchangeDevice class. In Figure 6 the classes of the package are described in UML, both classes from the core package are also in the diagram but specially marked. The reason why they are also in this diagram is just to show the origin of the classes in the devices package. As shown in the UML diagram this package encapsulates seven new Figure 6: The UML diagram of the devices package classes, five that are extended from the AbstractDataExchangeDevice class: • DatabaseExchangeDevice • NetworkExchangeDevice • FileExchangeDevice • ObjectExchangeDevice • ProcessExchangeDevice