1 / 34

Classes

Classes. Author: Hans v Leunen Editors: Henk de Vries & William Ringer. Classification. Classification simplifies handling Class-wide items need only to be handled once Features that are special to the individual must be treated separately for each member of the class.

moira
Download Presentation

Classes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Classes Author: Hans v Leunen Editors: Henk de Vries & William Ringer

  2. Classification • Classification simplifies handling • Class-wide items need only to be handled once • Features that are special to the individual must be treated separately for each member of the class. • The implementation becomes smaller and simpler when the class-wide part is implemented separately • If that is done systematically, it has sense to use the same principle for singletons

  3. A managers view onto the subject An in depth treatise for the technically interested Choose your trail

  4. Programming is modeling • Programming is a creative occupation • Programming is a way of modeling a natural or an artificial item in program code

  5. Modeling elements • Where painters use colors and forms to generate an abstraction of their subject, programmers will use properties, aspects of behavior, relations, communication, encapsulation and coordination as ingredients for their model • It is smarter to use mutually independent descriptors • The original, more natural modeling ingredients can be converted into a new set of mutually independent categories of modeling ingredients.

  6. Properties Relations Aspects of behavior Communication Encapsulation Coordination Modeling Elements Attributes Operations Protocol Trigger Envelop Taskmanagement& synchronization

  7. How programmers implement modeling elements • The original, more natural modeling ingredients can be converted in a new set of mutually independent categories of modeling ingredients. • Programmers have straightforward implementations for each of these new ingredients.

  8. Modeling => Implementation in SW Properties Attributes Datastructs Relations Operations Routines Aspects of behavior Protocol Documents Communication Trigger Call Encapsulation Envelop ADT Taskmanagement& synchronization Coordination (RTKOS)

  9. Grouping Design Elements 1 • The design elements can be divided in two groups: • A group that describes a class of similar items • A group that describes the individuals of that class • A group can be classified according to itsbehavior and the kind of its assets

  10. I & C I & C I & C I & C Wider Scope of Elements Properties Attributes Relations Operations C Aspects of behavior Protocol C+ Communication Trigger Encapsulation Envelop Taskmanagement& synchronization Coordination

  11. view Architecture Scope Creative andcombinatorialtalents of thearchitect Best practices rules Model target methods requirements

  12. model model model model View1.0 View1.0 View1.1 View1.1 View1.2 Architecture Dynamics model model target

  13. Grouping Design Elements 2 • The design elements can be divided in two groups: • A group that describes the passive relational part of the architecture • A group that describes the active part of the architecture

  14. Passiverelational Active View1.2 Services Architecture Split up Simple, publishable,specifies usage Complex,contains IP,specifies co-ordination

  15. Modeling => Division Properties Attributes Relations Passive Envelop Aspects of behavior Protocol Communication Operations Encapsulation Active Trigger Taskmanagement& synchronization Coordination

  16. Repository Repository IP-Repository Open-Repository Implement Passiverelational Active Interactiveprototyping View1.2 Incrementalsteps Services Exploiting the Division Publishable,specifies usage Skeleton target

  17. Implementation • The implementation of an item has a class related part and a part that sets the individual apart • The result is a binary representation of an abstract data type

  18. Class wide Individual Attribute Class ref Attribute Attribute Routine 1 Attribute Routine 2 Attribute Method Attribute Routine 3Routine 3a Method Attribute Routine 4 Method Routine 5 Method Routine 6Routine 6a Method Method Routine 6 Routine 3 Method Routine 7 Method Routine 8 Redirected ADTobject Orientation Environment 1 n ADT++ Object data Object data Class data Class data Inheritance

  19. Environment 1 Class wide Individual n Attribute Class ref Attribute Attribute ADT++ Routine 1 Attribute Routine 2 Attribute Method Attribute Routine 3Routine 3a Method Attribute Routine 4 Method Routine 5 Method Routine 6Routine 6a Method Object data Method Routine 6 Routine 3 Method Object data Routine 7 Class data Method Routine 8 Class data Redirected Inheritance Object Orientation, Deficiencies

  20. Encapsulation Environment Communicate with individual Generate new individual association association association Class (Operations) Individual (State) association Pass call tooperation

  21. Class Libraries base base Class libraries are structured sets of class modulesClass modules contain differences with respect to parent classBase class modules contain the full class

  22. library library Shell child unchanged unused Applications From Class Libraries Application children

  23. Shell child unchanged unused Implementing Distributed Services services Application children

  24. libraries Shell child unchanged unused Distributed Services Conflict services services Application children

  25. Oneuniform access way Environment Class wide Individual ADT++ Attribute Class ref Attribute Attribute Routine 1 Attribute Routine 2 Attribute Method Method Attribute Routine 3Routine 3a Class ref Method Method Attribute Routine 4 Method Method Routine 5 Method Method Routine 6Routine 6a Method Method Method Method Routine 3 Routine 6 Method Routine 7 Method Method Routine 8 Method Redirected Class data Encapsulation Effective IPR hiding OO  Component Orientation Environment 1 n ADT++ Object data Object data Class data Class data Inheritance

  26. The COM object model • In short the COM object model is an abstract data type that supports multiple vtbl data structures. • Each vtbl represents an interface • Each interface includes the base interface IUnknown • The COM object model is independent of the programming language

  27. B FuncB4 Object Interface (COM) hidden QueryInterface hidden IUnknown AddRef Release FuncA4 hidden A FuncA5 hidden hidden FuncA6 B QueryInterface hidden AddRef Release hidden FuncB4 FuncB5 hidden hidden hidden Vtbl A hidden hidden hidden hidden Class data Instance data Vtbl B

  28. COM deficiencies • The decision to let the clients of the component manage the reference counting appeared to be a design fault. • The result is, that a COM component is not robust • It can be abused by its clients

  29. Robust Component Object Model • In RCOM the reference counting support is deferred to the supporting infrastructure • The base interface contains a ‘ResetInstance’ method that brings the instance to its initial condition. This function may also include a cleanup task. • Cleanup and reset are required when a task that passed the instance is halted.

  30. B FuncB4 Under the control of the infrastructure Robust Component Object Model hidden QueryAccessPoint IAccessor hidden ResetInstance FuncA3 FuncA4 A hidden FuncA5 hidden hidden FuncA6 QueryAccessPoint B hidden ResetInstance FuncB3 FuncB4 reqItf1 FuncB5 conReq hidden reqItf2 Vtbl A hidden hidden hidden hidden Class data Instance data Vtbl B

  31. B FuncB4 Variable Variable Register Register Hardware Adding HW interfaces hidden QueryAccessPoint Accessor hidden ResetInstance FuncA3 Class data FuncA4 A hidden FuncA5 hidden hidden FuncA6 B QueryAccessPoint hidden ResetInstance FuncB5 FuncB4 reqItf1 FuncB5 conReq hidden reqItf2 Vtbl A hidden hidden hidden Vtbl B hidden Instance data Variable to register map

  32. B FuncB4 stream Variable Variable SWStream Register Register HWStream Adding Streaming Interfaces hidden QueryAccessPoint Accessor hidden ResetInstance FuncA3 Class data FuncA4 A hidden FuncA5 hidden hidden FuncA6 B QueryAccessPoint hidden ResetInstance FuncB5 FuncB4 reqItf1 FuncB5 conReq hidden reqItf2 Vtbl A hidden hidden hidden Vtbl B hidden Instance data Variable to register map Hardware

  33. Equipped for embedding • The HW interfaces, the streaming interfaces and the features of the component model render RCOM components particularly suitable for real-time embedded applications.

  34. Inheritance in Component Technology • Interfaces are in fact abstract component classes. • With respect to interfaces, component classes feature multiple specification inheritance • Via the CLSID components feature singlespecification inheritance • Via the IID interfaces feature singlespecification inheritance • Other forms of inheritance are not supported

More Related