Page 1 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Chapter 4 Component Models and Technology
Page 2 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Overview qIntroduction qACME Architectural Description Language qJava Bean Component Model qCOM, DCOM, MTS and COM+ qCORBA Component Model (CCM) q.NET Component Model qOSGI Component Model
Page 3 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Introduction qA Short Historical Perspective qComponent Interface and Connections qPerforming Services Transparently
Page 4 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology A Short Historical Perspective q Programming languages, can be seen from either l The run-time point of view or, l The design and reuse perspective
Page 5 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Component Interface and Connections q ADLs primarily address the issues related to the early phases of software engineering: l Design l Analysis q They identify a number of concepts, such as: l Architecture, configurations, connectors, bindings, properties, hierarchical models, style, static analysis and behavior.
Page 6 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Component Interactions Iteractions with traditional software entities Interactions with other components Interactions with other components Interactions with component infrastructure Components Traditional software entities Component Infrastructure
Page 7 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Majors steps in CBD lifecycle AspectPhaseActor Interface DefinitionDesigner Assembly Architect Implementation Developer Lifecycle Packaging, Deployment Administrator Framework, run-time support ExecutionEnd User
Page 8 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Performing Services Transparently
Page 9 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology ACME Architectural Description Language qComponents and Ports qConnectors and Roles q Systems and Attachments qRepresentations and Bindings qProperties, Constraints, Types and Styles
Page 10 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Components and Ports q Components l Represent the computational elements and data stores of a system. q Ports l Are the points of interaction between a component and its environment. Component Port
Page 11 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Connectors and Roles q Connectors l Represent interactions between components such as method calls or an SQL connection between a client and a database server. qThe interface of a connector is defined as a set of roles Connector Role
Page 12 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Systems and Attachments qThe structure of a system is specified by a set of components, a set of connectors, and a set of attachments. q Attachment l Links a component port to a connector role. Attachement
Page 13 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Representations and Bindings Connector Component Port Role Attachement Binding
Page 14 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Java Bean Component Model qKey Features qInterface of a Component qImplementation of a Component q Components Assembly q Packaging and Deployment
Page 15 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Key Features qBean Box q "A Java Bean is a reusable software component that can be manipulated visually in a builder tool”. q The Java Bean was designed for the construction of graphical user interface (GUI). q Explicitly tailored to interact in two different contexts: l At composition time, within the builder tool. l At execution time, with the runtime environment.
Page 16 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Interface of a Component q This model defines four types of port: l methods, l properties, l event sources and l event sinks called listeners. Read-only property Write-only property Property Method Event source Event sink (listener) Bounded property v Vetoable property ro wo 1 Unicast event source Ports
Page 17 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Implementation of a Component q Most bean components are implemented by a simple Java object, the object being encapsulated in the component, but there are more sophisticated implementations possible. l Wrapping a legacy object. l Multiple-objects implementation. l Dependency on traditional entities.
Page 18 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Implementations of Bean Components Object Method Method call Binding A simple implementation A more complex implementation
Page 19 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Components Assembly qAssembly is one of the key features of Java Bean though no not specific solution is provided. l Different ways of assembling components are supplied. Component-based assemblyHeterogeneous assembly
Page 20 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Packaging and Deployment q Java Beans define a model for packaging components into archives. l Includes the definition of dependency relationships between the package items. q The customization code can be more complex than the component itself! q Each package item can be marked "Design Only", so that they can be removed in a final application.
Page 21 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology COM, DCOM, MTS and COM+ qInterfaces and Assembly qImplementation qFramework qLifecycle
Page 22 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Interfaces and Assembly q A COM interface is seen as a C++ virtual class and takes the form of a list of data and function declarations without associated code. q All interfaces are descendants of the IUnknown interface. Component interface Interface Component implementation
Page 23 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Implementation q A COM object is a piece of binary code, written in any programming language, as long as the compiler generates code following the binary interoperability convention.
Page 24 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Framework q Standard interfaces q A simple run-time
Page 25 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Lifecycle q COM, and COM+ are strictly execution time and binary component models. No lifecycle issues are explicitly supported.
Page 26 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology CORBA Component Model (CCM) q Interface and Assembly q Framework : The Container Approach q Lifecycle
Page 27 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Interface and Assembly q A component interface is made of ports divided into: l Facets l Receptacles l Event sources l Event sinks Component interface Attribute Facet Event source Event sink Ports Receptacle Segment Component implementation
Page 28 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Framework : The Container Approach Services can be made available to components without having to change that component’s source code. CCM run-time infrastrucure container
Page 29 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Lifecycle q CCM is the best effort to date: l To gather the advances made in different fields, l To include a wide spectrum of lifecycle activities, while still claiming efficiency and heterogeneity capabilities, q However, the whole does not provide the feeling of being as “simple” as claimed.
Page 30 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology.NET Component Model qInterfaces and Assembly qImplementation qFramework qLifecycle
Page 31 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Interfaces and Assembly programming language approach for component programming. The program contains the information related to the relationships with other “components”, and that the compiler is responsible for generating the information needed at execution. q There is no explicit concept of connection but rather the traditional list of imported and exported resources.
Page 32 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Implementation q A component (assembly) is made of modules, which are traditional executable files (DLL). q Modules cannot be assemblies, thus the.NET model is not hierarchical. Component interface Attribute Method Event source Ports Event source Component implementation Modules
Page 33 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Framework q.NET relies on the traditional programming approach : the framework is seen as the language run-time support. q Transaction control relies on MTS.
Page 34 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Lifecycle Assemblies (and their modules) are local to an application, and thus different DLLs with same name can run simultaneously. Each assembly has a versioning information about itself and about the assemblies it depends on. Version control is delegated to the dynamic loader, which selects the “right” version. q Significantly improve the application packaging and deployment. q Early lifecycles phases do not seem to have received much attention.
Page 35 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology OSGI Component Model qComponents qInterface of a Bundle Component qAssembly of Bundle Components qImplementation of a Bundle Component
Page 36 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Components q A bundle use three kinds of ports to express its interactions with l Traditional technology l Other components The run-time environment Bundles may listen to events published by the framework such as the insertion of a new component in a system.
Page 37 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Interface of a Bundle Component Package export Package import Service use Ports Service interface static dynamic Interface of a bundle component
Page 38 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Assembly of Bundle Components A system is an evolving set of bundle components. q A bundle component publishes a service interface It can attach to it a set of properties describing its characteristics. q A component requires an interface for its use, It will select one via a query expression based on these properties. This flexibility also has its counterpart There is no guarantee than the service will continue to be available
Page 39 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Implementation of a Bundle Component q JAR archive containing: l Service components l Java packages l Other resources files Package Resource Service component Activator