The Seescoa Component Architecture
description
Transcript of The Seescoa Component Architecture
![Page 2: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/2.jpg)
Embedded systems
Code Size
Real time (latency, throughput,…)
Robust
Connectivity
Remote updates (update running software)
![Page 3: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/3.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/4.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/5.jpg)
OO Limits
Very rigid calling structure !!!Call methodWait for answerContinue
DebuggingTrace Program ExecutionProfile Program Execution
![Page 6: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/6.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/7.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/8.jpg)
The Component Architecture
Component System/Architecture = Runtime EnvironmentMessage Handling ServiceScheduler Naming Service
![Page 9: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/9.jpg)
HttpDaemon (1)
Provided Interface by HttpDaemon Html(Data) HtmlDone() RespondTo(Socket)
![Page 10: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/10.jpg)
HttpDaemon (2)
Required Interface for an URL-Handler GenerateHtml(Url)
![Page 11: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/11.jpg)
HttpDaemon (3)
HttpDaemon AccessCounterRespondTo(Socket)
GenerateHtml(Url)
Html(Data)
Html(Data)
HtmlDone()
Socket.Close()
![Page 12: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/12.jpg)
Writing a Component ?
Use componentclass
componentclass Httpd {…}
![Page 13: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/13.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/14.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/15.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/16.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/17.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/18.jpg)
HttpDaemon (5)
HttpDaemon AccessCounterRespondTo(<Socket>)
GenerateHtml(<Url>,>Socket<)
Html(<Data>,>Socket<)
Html(<Data>,>Socket<)
HtmlDone(>Socket<)
>Socket<.Close()
![Page 19: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/19.jpg)
Writing an Adapter (1)
A
![Page 20: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/20.jpg)
Writing an Adapter (2)
A
RealA
![Page 21: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/21.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/22.jpg)
Writing an adapter (4)
…
message SendMessage()
{
Message m=copyMessage(<Message>);
m.invoke=”bar”+m.invoke;
sendMessage(m);
}
…
![Page 23: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/23.jpg)
Writing an Adapter (5)
…
message Init()
{
ComponentSystem..Rebind(“A”,”RealA”);
ComponentSystem..AddReceiver(“A”,this);
ComponentSystem..AddSender(“A”,this);
}
}
![Page 24: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/24.jpg)
The Raw Component System
a scheduler a naming serviceBindRebindUnbind
Message deliverysendMessage(…) receiveMessage(…)
![Page 25: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/25.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/26.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/27.jpg)
The Standard Component System
Is called “ComponentSystem” ..Init(…) ..CreateComponent(…) ..DestroyComponent(…) ..SendMessage(…) ..ReceiveMessage(…) ..AddReceiver(…) ..AddSender(…) ..Bind(…), ..Rebind(…), ..Unbind(…) ..Undeliverable(…)
![Page 28: The Seescoa Component Architecture](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/28.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/29.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062408/56814424550346895db0c06b/html5/thumbnails/30.jpg)
Benefits (2)
ConcurrencyComponent system alternates between two
or more tasks. #Tasks is independent of #Processes
FlexibilityVery small systemSupport for tracing, profiling, debuggingExtendable