480 likes | 669 Views
Advanced Component-Based Software Engineering. Overview of several component models. Agenda. Unified Modelling Language (UML) Picolo Fractal BIP Autosar. Unified Modelling Language (UML). C. <<component>> C. Component diagram. Three representations for a component
E N D
Advanced Component-Based SoftwareEngineering Overview of several component models Séverine Sentilles
Agenda • Unified Modelling Language (UML) • Picolo • Fractal • BIP • Autosar Séverine Sentilles
Unified Modelling Language(UML) Séverine Sentilles
C <<component>> C Component diagram • Three representations for a component • But access points are required • Utilisation of interfaces • Utilisation of port <<component>> C Séverine Sentilles
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 Séverine Sentilles
Ports • Role: • Access point to the internal structure of the component • Can have 0 or several interfaces • Representation: <<component>> C Séverine Sentilles
<<component>> Client <<component>> Server IdenticalItf 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 Séverine Sentilles
<<component>> A <<component>> B 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 Séverine Sentilles
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 Séverine Sentilles
EJB Profile Séverine Sentilles
Agenda • Unified Modelling Language (UML) • Picolo • Fractal • BIP • Autosar Séverine Sentilles
Picolo Séverine Sentilles
Characteristics • A simple componentmodel • to understand how components work • Not suited for building real applications • Programinglanguage: Python • Developed by: • LIFL (FRANCE) Séverine Sentilles From “Picolo: A Simple Python Framework for Introducing Components Principles, 2005”
The component model Séverine Sentilles From “Picolo: A Simple Python Framework for Introducing Components Principles, 2005”
Agenda • Unified Modelling Language (UML) • Picolo • Fractal • BIP • Autosar Séverine Sentilles
The Fractal component model Séverine Sentilles
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) Séverine Sentilles
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) Séverine Sentilles
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 • … Séverine Sentilles
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.) Séverine Sentilles
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) Séverine Sentilles
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); } } Séverine Sentilles
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!"); } } Séverine Sentilles
Example Assembling 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> Séverine Sentilles
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) Séverine Sentilles
Agenda • Unified Modelling Language (UML) • Picolo • Fractal • BIP • Autosar Séverine Sentilles
BIP Séverine Sentilles
Priority Interaction Behavior A BIP component Structure 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) Séverine Sentilles
States Variables Ports Transitions 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 variablesused to store (local) data. • A set of transitions modeling atomic computation steps. Séverine Sentilles
component • Compound component: • new components from existing components Séverine Sentilles
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}. Séverine Sentilles Synchronization
Priorities • used to filter interactions among the feasible ones depending on given conditions Séverine Sentilles
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 Séverine Sentilles
Example Defining a component component Reactive port in, out data int x, y behavior state empty on in provided 0 < x do y:=f(x) to full state full on out to empty end end Séverine Sentilles
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 Séverine Sentilles
Agenda • Unified Modelling Language (UML) • Picolo • Fractal • BIP • Autosar Séverine Sentilles
Autosar Séverine Sentilles
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 Séverine Sentilles
Developed by Séverine Sentilles
View Séverine Sentilles
Components Layered architecture Séverine Sentilles
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 Séverine Sentilles
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 Séverine Sentilles
Component connexion Séverine Sentilles
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 Séverine Sentilles
Autosar and the main principles of CBSE • Reusability • ok • Substituability • At run-time: No (the desired system is static after design time) • Extensibility: • ? • Composability: • ? Séverine Sentilles
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 Séverine Sentilles