The Seescoa Component Architecture

30
The Seescoa Componen Architecture contact: [email protected]

description

The Seescoa Component Architecture. contact: [email protected]. Embedded systems. Code Size Real time (latency, throughput,…) Robust Connectivity Remote updates (update running software). OO Limits. Modularity Where does one class-hierarchy stop ? C++: STL - PowerPoint PPT Presentation

Transcript of The Seescoa Component Architecture

Page 1: The Seescoa Component Architecture

The Seescoa Component Architecture

contact: [email protected]

Page 2: The Seescoa Component Architecture

Embedded systems

Code Size

Real time (latency, throughput,…)

Robust

Connectivity

Remote updates (update running software)

Page 3: The Seescoa Component Architecture

OO LimitsModularityWhere does one class-hierarchy stop ?

C++: STLJava: Streaming Libraries

Over abstraction of frameworks ?Reusability of a frameworkWhat about adding an extra parameter ?

Page 4: The Seescoa Component Architecture

OO Limits

Static structurePlug in new behavior at runtime ???Dynamically replace behavior of certain

objectsC++: Multiple InheritanceJava: Interfaces

Write interface wrappers between classesC++: IDL -> proxyJava: RMIC

Page 5: The Seescoa Component Architecture

OO Limits

Very rigid calling structure !!!Call methodWait for answerContinue

DebuggingTrace Program ExecutionProfile Program Execution

Page 6: The Seescoa Component Architecture

OO Limits

Concurrency Try to do two tasks at the same time C++: Different threading/signal libraries Java: Synchronize

Scheduling Lower the logging priority in favor of the UI

Distribution Shared memory no good Synchronous calls doesn’t work

Page 7: The Seescoa Component Architecture

The Component Architecture

ComponentPiece of self-contained code & dataCommunicate asynchronouslyMessages are send trough ports

Precompiler: .component -> .javaMakes it easier to write component codeEnables the automatic extraction of MSC’s

Page 8: The Seescoa Component Architecture

The Component Architecture

Component System/Architecture = Runtime EnvironmentMessage Handling ServiceScheduler Naming Service

Page 9: The Seescoa Component Architecture

HttpDaemon (1)

Provided Interface by HttpDaemon Html(Data) HtmlDone() RespondTo(Socket)

Page 10: The Seescoa Component Architecture

HttpDaemon (2)

Required Interface for an URL-Handler GenerateHtml(Url)

Page 11: The Seescoa Component Architecture

HttpDaemon (3)

HttpDaemon AccessCounterRespondTo(Socket)

GenerateHtml(Url)

Html(Data)

Html(Data)

HtmlDone()

Socket.Close()

Page 12: The Seescoa Component Architecture

Writing a Component ?

Use componentclass

componentclass Httpd {…}

Page 13: The Seescoa Component Architecture

Handling Messages ?

The CS takes care of delivery, we only have to implement the messages Html, HtmlDone, GenerateHtml

These methods doesn’t return anything, nor do they take any parameters. (message keyword)

componentclass Httpd{...message Html() message HtmlDone() message RespondTo()}

Page 14: The Seescoa Component Architecture

Retrieving Arguments ?

Message methods doesn’t take any parameters. To retrieve the arguments use the <> notation.

componentclass Httpd {... message Html() {System.out.println(<Data>)} ...}

Page 15: The Seescoa Component Architecture

Sending Messages ?

To contact another component the Httpd can send a message to another component using the special .. Notation

...{...message RespondTo() {dispatcher(URL)..GenerateHtml(<Url:URL>);}...}

Page 16: The Seescoa Component Architecture

HttpDaemon (4)

HttpDaemon AccessCounterRespondTo(<Socket>)

GenerateHtml(<Url>)

Html(<Data>)

Html(<Data>)

HtmlDone()

Socket.Close()

How do we knowthis Socket ?

Page 17: The Seescoa Component Architecture

Hidden Arguments ?

We can pass extra hidden arguments from one message call to another using the >< notation

...{...message RespondTo() {dispatcher(URL)..GenerateHtml( <Url:URL>, >Socket:<Socket><);}...}

Page 18: The Seescoa Component Architecture

HttpDaemon (5)

HttpDaemon AccessCounterRespondTo(<Socket>)

GenerateHtml(<Url>,>Socket<)

Html(<Data>,>Socket<)

Html(<Data>,>Socket<)

HtmlDone(>Socket<)

>Socket<.Close()

Page 19: The Seescoa Component Architecture

Writing an Adapter (1)

A

Page 20: The Seescoa Component Architecture

Writing an Adapter (2)

A

RealA

Page 21: The Seescoa Component Architecture

Writing an Adapter (3)componentclass Adapter

{

message ReceiveMessage()

{

Message m:copyMessage(<Message>);

m.invoke=“foo”+m.invoke;

m.target=“RealA”;

sendMessage(m)

}

Page 22: The Seescoa Component Architecture

Writing an adapter (4)

message SendMessage()

{

Message m=copyMessage(<Message>);

m.invoke=”bar”+m.invoke;

sendMessage(m);

}

Page 23: The Seescoa Component Architecture

Writing an Adapter (5)

message Init()

{

ComponentSystem..Rebind(“A”,”RealA”);

ComponentSystem..AddReceiver(“A”,this);

ComponentSystem..AddSender(“A”,this);

}

}

Page 24: The Seescoa Component Architecture

The Raw Component System

a scheduler a naming serviceBindRebindUnbind

Message deliverysendMessage(…) receiveMessage(…)

Page 25: The Seescoa Component Architecture

Sending Messages

Before sending a message, the CS checks whether there is a proxy

If there is one, we wrap the message in a SendMessage(<Message:…>) message and queue it

Otherwise the message goes to the scheduler

Page 26: The Seescoa Component Architecture

Receiving Messages

Before receiving a message, the CS checks whether there is a proxyIf there is one, we wrap the message in an ReceiveMessage(<Merssage:…>) message and queue itIf there is an immediate target, we call receiveMessage upon the TargetOtherwise, we wrap the message in an Undeliverable(<Message:…>) message and queue it.

Page 27: The Seescoa Component Architecture

The Standard Component System

Is called “ComponentSystem” ..Init(…) ..CreateComponent(…) ..DestroyComponent(…) ..SendMessage(…) ..ReceiveMessage(…) ..AddReceiver(…) ..AddSender(…) ..Bind(…), ..Rebind(…), ..Unbind(…) ..Undeliverable(…)

Page 28: The Seescoa Component Architecture

The Distributed Component System

Rebinds “ComponentSystem”, is called “Portal”When creating a component, the instancename has to be prefixed with the name of the machine When sending a message to a local undeliverable target, we forward it to the effective machineWhen receiving a forwarded message, we send it through to the actual target.Written as a component itself

Page 29: The Seescoa Component Architecture

Benefits (1)

Plug in new behavior at runtime ??? Connect ports at runtime

Dynamically replace behavior of certain objects Rebind the name of a component

Write interface wrappers between components HandleMessage(…) ReceiveMessage(…) SendMessage(…)

Page 30: The Seescoa Component Architecture

Benefits (2)

ConcurrencyComponent system alternates between two

or more tasks. #Tasks is independent of #Processes

FlexibilityVery small systemSupport for tracing, profiling, debuggingExtendable