Date post: | 05-Jan-2016 |
Category: |
Documents |
Upload: | linette-ball |
View: | 215 times |
Download: | 1 times |
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.• 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
Choose your trail
• A managers view onto the subject
• An in depth treatise for the technically interested
Programming is modeling
• Programming is a creative occupation
• Programming is a way of modeling a natural or an artificial item in program code
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.
Modeling ElementsAttributes
Trigger
Protocol
Operations
Envelop
Properties
Aspects of behavior
Relations
Communication
Encapsulation
Coordination Task management& synchronization
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.
Modeling => Implementation in SW
Attributes
Trigger
Protocol
Operations
Datastructs
Routines
Documents
Call
Envelop ADT
(RTKOS)
Properties
Aspects of behavior
Relations
Communication
Encapsulation
Coordination Task management& synchronization
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 its
behavior and the kind of its assets
Wider Scope of ElementsAttributes
Trigger
Protocol
Operations
Envelop
Properties
Aspects of behavior
Relations
Communication
Encapsulation
Coordination
C
C+
Task management& synchronization
I C&
I C&
I C&
I C&
Best practices
Architecture Scope
rules
methods
requirements
view target
Model
Creative andcombinatorialtalents of the
architect
model
model
model
model
model
model
Architecture Dynamics
View1.0View1.0
View1.1View1.1
View1.2 target
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
Architecture Split up
Passiverelational
Active
Simple, publishable,
specifies usage
Complex,contains IP,
specifies co-ordination
View1.2
Services
Modeling => DivisionAttributes
Trigger
Protocol
Operations
Envelop
Properties
Aspects of behavior
Relations
Communication
Encapsulation
Coordination
Passive
Active
Task management& synchronization
Exploiting the Division
Passiverelational
Active
Skeleton
Incrementalsteps
Implement
RepositoryRepository
Open-Repository
View1.2
Interactiveprototyping
target
Publishable,specifies
usageServices
IP-Repository
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
n1
Redirected
Class data
Object data
ADTobject Orientation
Attribute
Attribute
Routine 1
Routine 2
Routine 4
Routine 5
Routine 3
Routine 6
Class ref
Attribute
Attribute
Attribute
Individual
Environment
Routine 6 Routine 6a
Routine 3 Routine 3a
Object data
Class data
Method
Method
Routine 7
Routine 8
Attribute
Attribute
Class wide
Method
Method
Method
Method
Method
Method
Object Orientation, Deficiencies
n1
Redirected
Class data
Object data
Attribute
Attribute
Routine 1
Routine 2
Routine 4
Routine 5
Routine 3
Routine 6
Class ref
Attribute
Attribute
Attribute
Individual
Environment
Routine 6 Routine 6a
Routine 3 Routine 3a
Object data
Class data
Method
Method
Routine 7
Routine 8
Attribute
Attribute
Class wide
Method
Method
Method
Method
Method
Method
Encapsulation
Individual
(State)
Class(Operations)
associationassociationas
socia
tion
EnvironmentGenerate new
individual
Communicate with individual
Pass call tooperation
asso
ciat
ion
base
base
Class Libraries
Class libraries are structured sets of class modulesClass modules contain differences with respect to parent class
Base class modules contain the full class
Application children
Shell
library
Applications From Class Libraries
child unchanged
library
unused
Application children
Shell
Implementing Distributed Services
child unchanged
unused
services
Application children
Shell
libraries
Distributed Services Conflict
child unchanged
unused
services
services
OO Component Orientation
n1
Redirected
Class data
Object data
Attribute
Attribute
Routine 1
Routine 2
Routine 4
Routine 5
Routine 3
Routine 6
Class ref
Attribute
Attribute
Attribute
Individual
Environment
Routine 6 Routine 6a
Routine 3 Routine 3a
Object data
Class data
Method
Method
Routine 7
Routine 8
Attribute
Attribute
Class wide
Method
Method
Method
Method
Method
Method
Environment One uniform access way
Class data
Effective IPR hiding
Class ref
Method
Method
Method
Method
Method
Method
Method
Method
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
Object Interface (COM)
hidden
hiddenhiddenhiddenhidden
hidden
hidden
hidden
hidden
hidden
hidden
hidden
hiddenQueryInterfaceAddRefReleaseFuncB4FuncB5
QueryInterfaceAddRefRelease
FuncA6
FuncA4FuncA5
Instancedata
Vtbl AVtbl A
Vtbl BVtbl BClass dataClass data
AA
BB
hidden
IUnknown
BB
FuncB4
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
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.
Robust Component Object Model
hidden
hiddenreqItf2conReqreqItf1
hidden
hidden
hidden
hidden
hidden
hidden
hidden
hiddenQueryAccessPoint
ResetInstance
FuncB3FuncB4FuncB5
QueryAccessPointResetInstanceFuncA3
FuncA6
FuncA4FuncA5
Instancedata
Vtbl AVtbl A
VtblVtbl B BClass dataClass data
AA
BB
hidden
IAccessor
BB
FuncB4
Under the control of the infrastructure
Adding HW interfaces
hidden
hiddenreqItf2conReqreqItf1
hidden
hidden
hidden
hidden
hidden
hidden
hidden
hidden QueryAccessPointResetInstanceFuncB5FuncB4FuncB5
QueryAccessPointResetInstanceFuncA3
FuncA6
FuncA4FuncA5
Instancedata
Vtbl A
Vtbl B B
Class dataAA
BB
hidden
Accessor
BB
FuncB4
Hardware
Register
Variable
Register
Variable
Variable to register map
Adding Streaming Interfaces
hidden
hiddenreqItf2conReqreqItf1
hidden
hidden
hidden
hidden
hidden
hidden
hidden
hidden QueryAccessPointResetInstanceFuncB5FuncB4FuncB5
QueryAccessPointResetInstanceFuncA3
FuncA6
FuncA4FuncA5
Instancedata
Vtbl A
Vtbl B B
Class dataAA
BB
hidden
Accessor
BB
FuncB4
Hardware
Register
Variable
Register
Variable
Variable to register map
HWStream
SWStream
stream
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.
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 single
specification inheritance• Via the IID interfaces feature single specification
inheritance• Other forms of inheritance are not supported