next up previous
Next: 3.2.3 Operations instead of Up: 3.2 Steps for optimizing Previous: 3.2.1 New Superclasses for

3.2.2 New Subclasses instead of "type" Variables

 


  
Figure 4: Optimized object model for UNIX workstations (partial view)
\begin{figure}


\includegraphics [width=0.65\textwidth]{objektmodell2.eps}

\end{figure}

This optimization is the answer to the second criticism which addresses the fact that different kinds of objects can be instantiated from one object class. Unfortunately, this is contradictory to the concept of object-orientation which implies that instances of the same object class must have the same properties. In the first model it was impossible to assign different properties to different types of an object class; each instance of a class would have had the same structure, independent of its type. An example may illustrate this: It was possible to instantiate objects of different kinds from the Device class by assigning different values to the Type attribute; each of these components would share only three very generic attributes (Index, Description and State). This is another reason for introducing the virtual, i.e. not instantiable base class GenericDevice as the root of the inheritance hierarchy (see also 3.2.1). If an object of any system component has to be generated, this does not lead to an instance of GenericDevice but yields a new instance of the corresponding subclass.

A similar modification affects the Storage class: Here, the different kinds of storage (Ram, VirtualMemory, FLCache and SLCache[*] could be generated, but it was not possible to assign different properties to different kinds of storage devices. Therefore, two new classes permanentStorageDevice and volatileStorageDevice have been introduced into the model: The former is the superclass for objects like hard disks, magnetic tapes and floppy disks. The latter class encompasses the components which were initially instantiated through the Storage class i.e. the new subclasses Ram, VirtualMemory, FLCache and SLCache.


next up previous
Next: 3.2.3 Operations instead of Up: 3.2 Steps for optimizing Previous: 3.2.1 New Superclasses for
Copyright Munich Network Management Team