Download presentation
Presentation is loading. Please wait.
1
OOD Design of Processes 2 Server Patterns ITV Modelbased Analysis and Design of Embedded Software Anders P. Ravn & Arne Skou Aalborg University February 2011
2
Simple Generic Architecture OAD p.196 «component» Interface «component» Model «component» UserInterface «component» SubsystemInterface «component» Platform «component» OS «component» FileSystem «component» Function...
3
The Task to Solve Assume: Design is already mapped to Sequential Programs (Classes) «component» QQQQQQQQQ «component» MMMMMMMMM Provide: Architecture mapped to Concurrent Programs on a Platform «component» Interface «component» UserInterface «component» SystemInterface «component» Model «component» Function «component» Platform «component» OS «component» FileSystem
4
Platform Characteristics onenone Ordinary c++, c threadsshared objects Java, CORBA, SYMBION? tasksasynch. message Posix, RTOS ProcessesSynchronizationExample
5
Concurrent Access «component» Interface «component» UserInterface «component» SystemInterface «component» Model «component» Platform «component» OS «component» FileSystem «component» Function «interface» Application read(Key) : ReadData update(UpdateData) compute(Mode) : Result attach(SignalHandler) «synchronized» Wrapper... read(Key k) : ReadData update(UpdatDatae u) compute(Mode m) : Result attach(SignalHandler sh) + concurrent access implements
6
Implementation (Java) synchronized class Wrapper {... public void update(Update u)... } }; «synchronized» Wrapper... update(Update u) class Wrapper {... public synchronized void update(Update u)... } }; class Wrapper {... public void update(Update u)... synchronized{... } } };
7
Server Pattern: Interface Component «component» Interface «component» UserInterface «component» SystemInterface «component» Model «component» Platform «component» OS «component» FileSystem «component» Function «interface» Application read(Key) : ReadData update(UpdateData) compute(Mode) : Result attach(SignalHandler) «synchronized» ServerPort... read(Key k) : ReadData update(UpdatDatae u) compute(Mode m) : Result attach(SignalHandler sh) IFunction from Function Server + concurrent access
8
Server Behaviour Server wait op 2 op 1 op 3 complete
9
Server Pattern: Function Component «component» Interface «component» UserInterface «component» SystemInterface «component» Model «component» Function «component» Platform «component» OS «component» FileSystem «interface» IFunction read(Key) : ReadData update(UpdateData) compute(Mode) : Result attach(SignalHandler) IModel from Model... read(Key k) : ReadData update(UpdateData u) compute(Mode m) : Result attach(Signalhandler sh) «synchronized» FServerPort FServer
10
And so on for a Model Server... «component» Interface «component» UserInterface «component» SystemInterface «component» Model «component» Function «component» Platform «component» OS «component» FileSystem
11
- more code - complex code + short response times + concurrency Server Call Pattern - update p:FServenPorthp: ServerPortm: Model update(u) read(k) put(d) cf. OAD p.255-259 h: Server wait(op) update(u) wait(op) f: FServer wait(op)
12
- more code - complex code - long response times ? RMI / RPC Server Call Pattern - read fp:FServerPorthp: ServerPortm: Model read(k) cf. OAD p.255-259 h: Server wait(op) read(k) wait(op) f: FServer wait(op) return(d)
13
Exercises 1.Adapt your System (Model Component) to be a Server. 2.How many Client processes would you support concurrently?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.