cbse in the context of real-time systemscs00pe/epl603/lectures/lect17_vaidasgiedrimas.pdfcbse in the...

53
CBSE in the context of real-time systems [email protected] 1 Dr. Vaidas GIEDRIMAS Siauliai University Lithuania

Upload: others

Post on 18-Jan-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

CBSE in the context of real-time systems

[email protected] 1

Dr. Vaidas GIEDRIMAS Siauliai University

Lithuania

Page 2: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Outline

l The definition of component and CBSE

l Distributed component systems l Real-time component

systems

2

Page 3: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

What is a software component ?

l  (It is) Component or not component? That is the question!

Hamlet

3

Page 4: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Components

l  Components provide a service without regard to where the component is executing or its programming language l  A component is an independent

executable entity that can be made up of one or more executable objects;

l  The component interface is published and all interactions are through the published interface;

I.Sommerville Software Engineering 2008 4

Page 5: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Component Replacement

l  Objects are only partially replaceable.

l  Components must implement interfaces. l  You can upgrade (add features) but don’t change l  Use versioning system or support old interfaces

l  When components only talk via interfaces, you can upgrade/enhance with lower risk.

http://www.howardism.org/geekin 5

Page 6: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Object Replacement

l  Replacing objects means editing all references

§  System Testing Critical •  Forgotten references

http://www.howardism.org/geekin 6

Page 7: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Component Replacement

l  Each component only talks to another unit via an interface.

l  Components can be safely replaced by unit testing the component’s interface

l  System testing is now less critical

http://www.howardism.org/geekin 7

Page 8: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

8

The CBSE process

l Development of Components l Development of Component-based

systems

Page 9: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Development of Component-based systems

9

Page 10: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Outline

l  The definition of component and CBSE l Distributed component systems l Real-time

component systems

10

Page 11: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Outline

l  The definition of component and CBSE l Distributed component systems l Real-time

component systems

11

Page 12: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

12

Types of Components-servers

Computer (-ers)

File

Internal server

The same The same

Local server

The same Separate (*.exe, *dll, ...)

Remote server

Separate Separate

Page 13: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Distributed systems

l Types of distributed systems l The role of middleware l Marshalling

13

Page 14: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Component framework/ Middleware

Middleware (e.g. ORB, .NET Framework,…)

Component-server Client

Imaginable server

Imaginable client

14

Page 15: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

(Very old) Case-study: COM & DCOM

DCOM

15

Page 16: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Distributed systems

l Types of distributed systems l The role of middleware l Marshalling

16

Page 17: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Connection via sinks

Client Server

StackBuilderSink

Object on server

Formatter Sink

Custom Sinks Custom Sinks Custom Sinks

Transport Sink

Proxy

ClinetObject

Formatter Sink

Custom Sinks Custom Sinks Custom Sinks

Transport Sink

17

Page 18: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Marshaling

l Marshal by Value l Marshal by Reference

18

Page 19: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Marshal by Value

l  Objects are “packed” l The copy of object is sended to the

clinet l  Copy and original are not related and

exist independently each other.

19

Page 20: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Marshal by Reference

l  Object’s address is “packed” only. l  Only this address is sended to the

client l Client uses the same object as

server (but via Proxy)

20

Page 21: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

How to save the state of object ?

l  Persistance l The ability to prolong object “lifetime”.

l Serialization l Object is packed and saved in the file,

memory etc. l Object is created and their state is

settet using package

21

Page 22: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

.NET Serialization example

l By Default objects are not serializable l To make objects are not serializable you

should use Attribute: [Serializable] Public class MyClass { ... }

22

Page 23: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

.NET Serialization example (2)

using System.Runtime.Serialization.Formatters.Binary;

Class1 o1 = new Class1(); Stream st; st= new FileStream(@”C:\tmp\file.dat”, FileMode.Create, FileAccess.Write);

IFormatter frm = new BinaryFormatter(); frm.Serialize(st, o1); st.close

23

Page 24: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

.NET Serialization example (3) using System.Runtime.Serialization.Formatters.Binary;

Class1 o1; // new not used! Stream st; st= new FileStream(@”C:\tmp\failas.dat”, FileMode.Open, FileAccess.Read);

IFormatter frm = new BinaryFormatter(); o1 = (Class1)frm.Deserialize(st); st.close

24

Page 25: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Outline

l  The definition of component and CBSE l  Distributed component systems l Real-time component

systems

25

Page 26: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Real-time component-based systems

l What are the differences? l Examples l Main issues and problems

26

Page 27: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Singularities of the CBRT systems

l Many (but not all!) RT systems are embedded systems too.

l The device is too small to fit the full-featured middleware l  Some modifications of CORBA or J2ME are

used l  Particular middleware is designed

l The concept of component is different!

27

Page 28: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Levels of abstraction of Software components

l Component specification l Component implementation l Component deployment l Component object

l RT component sometimes is semi-hardware component!

28

Page 29: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Singularities of the CBRT systems (2)

l  In common cases only the reuse is possible only within particular enterprise. l  There is no wide market of RT components l  The generators of components are used.

l The question of component trust and quality is extremely important.

29

Page 30: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Real-time component-based systems

l What are the differences? l Examples l Main issues and problems

30

Page 31: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Examples of RTE component-based systems

l CoSMIC l MoDES

l  COMDES l UPPAAL PORT

31

Page 32: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

CoSMIC

l Component Synthesis using Model Integrated Computing

l Generative approach to wrap legacy systems and to create new ones.

l CIAO™ (Component Integrated ACE ORB) middleware

l The Adaptive Communication Environment ACE™

Schmidt, D.C. et al. (2002). CoSMIC: an MDA Generative tool for Distributed Real-time and Embedded Component Middleware and Applications. 32

Page 33: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

CoSMIC

http://www.cs.wustl.edu/~schmidt/PDF/MDA4DRE.pdf 33

Page 34: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

CoSMIC

Schmidt, D.C. et al. (2002). CoSMIC: an MDA Generative tool for Distributed Real-time and Embedded Component Middleware and Applications. 34

Page 35: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

MoDES

l Model driven development of Inteligent embedded systems

l The approach of the A.Ravn’s group

l Realted with: l  ARTIST (Advanced Real Time Systems) l  COMDES

35 http://modes.cs.aau.dk

Page 36: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

MoDES

36 http://modes.cs.aau.dk

Page 37: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

COMDES

l The goal of the system is the rapid modeling and validation of control software at a higher level of abstraction.

l  It defines formally various kinds of components to address the critical requirements of the targeted domain, taking into account the architectural and behavioral aspects of the system.

37 Xu Ke et al. (2007) COMDES-II: A Component-Based Framework for

Generative Development of Distributed Real-Time Control Systems

Page 38: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

COMDES

l The goal of the system is the rapid modeling and validation of control software at a higher level of abstraction.

l  It defines formally various kinds of components to address the critical requirements of the targeted domain, taking into account the architectural and behavioral aspects of the system.

38 Xu Ke et al. (2007) COMDES-II: A Component-Based Framework for

Generative Development of Distributed Real-Time Control Systems

Page 39: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

COMDES

39 Xu Ke et al. (2007) COMDES-II: A Component-Based Framework for

Generative Development of Distributed Real-Time Control Systems

Page 40: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

ARTIST

This project is leading-edge research in embedded systems design issues in the Joint Programme of Research Activities (JPRA), and complementary activities around shared platforms and staff mobility in the Joint Programme of Integration Activities (JPIA).

40 http://www.artist-embedded.org/artist/Strategic-Objectives,188.html

Page 41: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

UPPAAL

l  Integrated tool environment for modeling, validation and verification of real-time systems modeled as networks of timed automata, extended with data types

41 http://www.uppaal.org/

Page 42: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

UPPAAL PORT

l The tool for component-based modelling, simulation, and verification of real-time and embedded systems modelled as real-time components.

l Can be used together with the particular Eclipse plugin –SAVE integrated Development Enviroment (IDE).

42 http://www.it.uu.se/research/group/darts/uppaal/port/

Page 43: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

UPPAAL PORT

43 http://www.it.uu.se/research/group/darts/uppaal/port/

Page 44: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Why the CORBA/CCM ?

l  In many cases the implementations of CORBA/CCM are used: l  CIAO l  SaveCCM

l Why not .NET, J2ME or other?

44

Page 45: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Real-time component-based systems

l What are the differences? l Examples l Main issues and problems

45

Page 46: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

CBSE problems: Interface incompatibility

l Parameter incompatibility l  operations have the same name but are of

different types. l Operation incompatibility

l  the names of operations in the composed interfaces are different.

l Operation incompleteness l  where the provided interface of one

component is a subset of the required interface of another.

I.Som

mer

ville

Sof

twar

e E

ngin

eerin

g 20

08

46

Page 47: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Component identification issues

l  Trust. l  You need to be able to trust the supplier of a

component. In the best case, an untrusted component may not operate as advertised; in the worst case it can breach your security.

l  Requirements. l  Different groups of components will satisfy different

requirements. l  Validation.

l  The component specification may not be detailed enough to allow comprehensive tests to be developed.

l  Components may have unwanted functionality. How can you test this will not interfere with your application?

I.Sommerville Software Engineering 2008 47

Page 48: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

CBSE problems (2)

l Component trustworthiness l  how can a component with no available

source code be trusted? l QoS guarantees

l  who can give guarantees that component will finish on time? l  e.g United States Patent Application

20090262119

l Component certification l  who will certify the quality of components?

48

Page 49: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

CBSE problems (3)

l Emergent property prediction l  how can the emergent properties of

component compositions be predicted? l Requirements trade-offs

l  how do we do trade-off analysis between the features of one component and another?

I.Sommerville Software Engineering 2008 49

Page 50: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Main references

l  I.Sommerville Software Engineering 2008

l G.T. Heineman, W.T. Council Component-based software enginering:putting the pieces together 2001

50

Page 51: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Main references (2)

l  C.Szyperski Component Software: Beyond Object-Oriented Programming (2nd Ed.) 2002

l  I. Crnkovic, M. Larsson Building Reliable Component-Based Software Systems 2002

51

Page 52: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

Main references (3)

l J.Lowy Programming .NET components 2nd Ed. 2005

52

Page 53: CBSE in the context of real-time systemscs00pe/epl603/lectures/Lect17_VaidasGiedrimas.pdfCBSE in the context of real-time systems vaigie@mi.su.l 1 Dr. Vaidas GIEDRIMAS Siauliai University

CBSE in the context of real-time systems

[email protected] 53

Dr. Vaidas GIEDRIMAS Siauliai University

Lithuania