Post on 16-Jan-2016
23-04-21 Séverine Sentilles 1
Advanced Component-Based SoftwareEngineering
Overview of several component models
23-04-21 Séverine Sentilles 4
Component diagram
Three representations for a component
But access points are required• Utilisation of interfaces
• Utilisation of port
C<<component>>
C<<component>>
C
23-04-21 Séverine Sentilles 5
Interfaces
Role:• Specification of the access point• Required functionalities• Provided functionalities
2 existing representation• The most descriptive• The compact
• The compact
<<interface>>
ProvidedItf
<<component>>C
<<interface>>
RequiredItf
<<component>>C
ProvidedItf RequiredItf
23-04-21 Séverine Sentilles 6
Ports
Role:• Access point to the internal structure of the
component
• Can have 0 or several interfaces
Representation:
<<component>>C
23-04-21 Séverine Sentilles 7
Relationship between components
Use the notion of connector• Roughly a way to link components together & make
them ”communicate” via a request of services
Generalisation of the means of communication Example:
• Client-server• Pipe&filter• Message exchange
Can also be called horizontal composition
<<component>>Client
<<component>>Server
IdenticalItf
23-04-21 Séverine Sentilles 8
Vertical composition
Can also be called hierarchical composition Role
• To increase the component granularity
• To expose the content of the component
Use the notion of delegation connector (between two ports)
<<component>>C
<<component>>A
<<component>>B
23-04-21 Séverine Sentilles 9
Profile UML
Extension of the UML model in order to adapt it to the particular requirements of a context
Uses• Stereotypes• Tagged values• OCL Constraints
Examples:• Profile for EJB components• Profile for a software architecture
23-04-21 Séverine Sentilles 14
Characteristics
A simple component model
• to understand how components work
• Not suited for building real applications
Programing language: Python
Developed by:
• LIFL (FRANCE)
From “Picolo: A Simple Python Framework for Introducing Components Principles, 2005”
23-04-21 Séverine Sentilles 15
The component model
From “Picolo: A Simple Python Framework for Introducing Components Principles, 2005”
23-04-21 Séverine Sentilles 23
Characteristics
Hierarchical, Reflexive, Open Allow the sharing of components Extensible
Several implementation• Julia (Java)• Think (C)• FracTalk (smalltalk)• FracNet (.NET)
Developed by• France Telecom R&D (FRANCE)• INRIA (FRANCE)
23-04-21 Séverine Sentilles 24
Components Existence at compile-time and run-time “3” types
• Primitive• Composite• (Shared)
Divided in 2 parts• Membrane
• Management of the extra-functional properties (Controllers)• Ex: Binding, Life-cycle, state, etc.• Extensible (open set of control capabilities)
• Content (management of the functional properties) Reflexive capabilities
• execution and internal structure of component can be made explicit
• through well-defined interfaces• Extendable/adaptable (to fit the programmer’s constraints and
objectives)
23-04-21 Séverine Sentilles 25
Interfaces
Access point to the components Characteristics:
• Client (required)/Server (provided)
• Mandatory/optional
• Simple/multiple Some predetermined interface (used in the membrane)
• Binding-controller-itf
• Lifecycle-controller-itf
• Name-controller-itf
• …
23-04-21 Séverine Sentilles 26
Communication
2 types:• Primitive binding:
• link a server interface to a client interface within a component
• Composite binding:
• Communication path between an arbitrary number of component interfaces
• primitives bindings
• and/or binding components (stub, skeleton, adapters, etc.)
23-04-21 Séverine Sentilles 27
Julia
Small, efficient, extensible run-time framework Programming language: Java Relies on a combination of interceptors and mixins (for the
programming of the reflective features)
23-04-21 Séverine Sentilles 28
Example
The Serveur Component:
@FractalComponent(controllerDesc="primitive")@Provides(
interfaces=@Interface(name="s",signature=Service.class) )
public class ServeurImpl implements Service {public void print( String msg ) {
System.out.println(msg);} }
23-04-21 Séverine Sentilles 29
Example
The Client Component:
@FractalComponent(controllerDesc="primitive")@Provides(
interfaces= @Interface(name="r",signature=Runnable.class)
)public class ClientImpl implements Runnable {
@Requires(name="s")private Service service;
public void run() {service.print("Hello world!");} }
23-04-21 Séverine Sentilles 30
ExampleAssembling the components:
<definition name="HelloWorld"><interface name="r" role="server"signature="java.lang.Runnable" />
<component name="client" name="Client"><interface name="r" role="server" signature="java.lang.Runnable" /><interface name="s" role="client" signature="Service" /><content class="ClientImpl" /></component>
<component name="server" name="Server"><interface name="s" role="client" signature="Service" /><content class="ServerImpl" /></component>
<binding client="this.r" server="client.r" /><binding client="client.s" server="server.s" /> </definition>
23-04-21 Séverine Sentilles 31
Fractal and the main principles of the CBSE
Reusability• Utilisation of type system, communication semantic,
component semantic=> risk to have a conflict/incompatibility between component
developed independently Substituability
• Possible ? Extensibility
• At design-time: ok
• At run-time: with the introspection mechanism ? Composability:
• Behaviour superimposed by the ”parent-component” to the subcomponents (extra-functional properties)
23-04-21 Séverine Sentilles 34
Characteristics Framework for modelling heterogeneous real-time components Developed by Verimag (FRANCE) Hierarchical Structured in 3 layers <B, I, P>:
• B: Behavior
• I: Interaction (a set of connectors describing the interactions between transition of the behavior)
• P: Priority rules (set of constraints describing scheduling policy for interaction)
Behavior
Interaction
Priority
A BIP componentStructure
23-04-21 Séverine Sentilles 35
Components
A component consists of:• A set of ports : action names used for synchronization with
other components.
• A set of control states: synchronization points.
• A set of variables used to store (local) data.
• A set of transitions modeling atomic computation steps.
Ports
States
Transitions
Variables
23-04-21 Séverine Sentilles 36
component
Compound component:• new components from existing components
23-04-21 Séverine Sentilles 37
Communication styles
Interactions• Synchronous
• Rendez-vous
• Broadcast
• Utilisation of connectors• Set of ports from different components that can be
involved in an interaction
• Ex: p1, p2, p3 ports of 3 distincts components, then the connector {p1,p2,p3} has => 7 interactions: p1, p2, p3, {p1,p2}, {p1,p3}, {p2,p3}, {p1,p2,p3}.
Synchronization
23-04-21 Séverine Sentilles 38
Priorities
used to filter interactions among the feasible ones depending on given conditions
23-04-21 Séverine Sentilles 39
BIP and the main principles of CBSE
Reusability• existing components can be combined to generate
complex components using platform glue Substituability
• ? Extensibility
• ? Composability:
• Utilization of parameterized binary composition operator
• The product of two components consists in composition layer by layer
23-04-21 Séverine Sentilles 40
Example
Defining a component
component Reactiveport in, outdata int x, ybehavior
state emptyon in provided 0 < x do y:=f(x) to full
state fullon out to empty
endend
23-04-21 Séverine Sentilles 41
Example
Defining an interaction
connector C1 = p1|p2|p3
behavior
on p1|p2|p3 provided ¬(x1 = x2 = x3)
do x1, x2, x3 := MAX(x1, x2, x3)
end
23-04-21 Séverine Sentilles 44
Chacteristics
Automotive Open System Architecture Goal: Separation of concerns
• Software components deals with application logic and can be developed independently of the underlying hardware and os
• Middleware-layer handles aspects of remote communication, component lifecycle, scheduling, timing as well as OS abstraction.
configurable/customizable run-time environment Adding new functions
• product variants, platforms
23-04-21 Séverine Sentilles 48
Components
Independent of the infrastructure Ports and connectors No imposed size
• Reusable piece of functionality (filter)• An entire automotive functionality
Sensors/actuators• Particular components• Encapsulate the dependencies of the application on specific
sensors/actuators crossing module boundaries (function distribution)
• one function: several SW components one/several ECUs• one ECU: several SW Components from different
functions / vendors
23-04-21 Séverine Sentilles 49
Component (cont)
Owns a description (SW-C Description)• Operations and datas provided/required
• Requirements on the infrastructure
• Resources needed (CPU-time, memory)
• Information regarding the specific implementation of the component
23-04-21 Séverine Sentilles 51
Communication style
Communication style• Client/server
• Synchronous communication pattern(The client can be blocked)
• Sender/Receiver• Asynchronous communication pattern
(the sender is not blocked)
• Event is considered as a subcategory of sender/receiver
23-04-21 Séverine Sentilles 52
Autosar and the main principles of CBSE
Reusability• ok
Substituability• At run-time: No
(the desired system is static after design time)
Extensibility:• ?
Composability:• ?
23-04-21 Séverine Sentilles 53
Literature Unified Modelling Language (UML) Picolo
• Picolo: A Simple Python Framework for Introducing Components Principles• http://www.win.tue.nl/~mchaudro/cbse2006/PicoloTalk.pdf• http://www.win.tue.nl/~mchaudro/cbse2006/Picolo%20Introducing%20Components%20using
%20Python.pdf
Fractal• The Fractal Component Model and Its Support in Java
• http://fractal.objectweb.org/doc/pub/SPE06.pdf
• Fractal tutorial at ICAR 2006 (in French)• http://sardes.inrialpes.fr/ecole/2006/cours-fractal.pdf
BIP• Modeling Heterogeneous Real-time Components in BIP
• http://www-verimag.imag.fr/%7Easync/BIP/publications/BIP-invited-paperSEFM06.pdf
• A Methodology and Supporting Tools for the Development of Low-Footprint and Safe Embedded Systems
• http://www-verimag.imag.fr/%7Easync/BIP/publications/BIP2THINK.pdf AUTOSAR
• AUTOSAR: Technical Overview• http://www.autosar.org/download/AUTOSAR_TechnicalOverview.pdf
• AUTOSAR: Standardization of software architecture in automotive industry• http://symposium.itea2.org/symposium2006/main/presentations/day_2/
AUTOSAR_Standardization_of_software_architecture_in_automotive_industry.pdf?PHPSESSID=433abcfec16c19b0dbb2554976