In the simplest case, an object in the Workplace Shell consists of methods and instance data. The Workplace Shell communicates events to the object using messages, which in turn invoke the object's methods to perform the processing indicated by the event. This is in accordance with the definition of an application object given in The Presentation Manager Application Model. Note that since the Workplace Shell provides a more extensive inheritance hierarchy than the base Presentation Manager application model, the method invoked by a particular message may belong explicitly to the object in question, or may belong to its parent (and be inherited from that parent).
The structure of an object in the Workplace Shell is therefore very similar to that of a window in the conventional Presentation Manager application model; the Workplace Shell object simply takes the object-oriented concepts to a higher degree of implementation. The constructs implemented by Presentation Manager under previous versions of OS/2 can, therefore, often be implemented more elegantly with the Workplace Shell.
For the remainder of this chapter, an example will be used to explain the structure and behavior of an object class. The example used is that of a specific type of Workplace Shell folder, which has a password defined so that it can be locked to prevent access by an unauthorized user. This object class is implemented by subclassing the WPFolder class to create a new object class named PWFolder, adding new methods and overriding existing methods where appropriate. Sample code is provided in the text for the various methods used to add the password protection to the folder.