Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pattern Oriented Software Architecture for Networked Objects Based on the book By Douglas Schmidt Michael Stal Hans Roehnert Frank Buschmann.

Similar presentations


Presentation on theme: "Pattern Oriented Software Architecture for Networked Objects Based on the book By Douglas Schmidt Michael Stal Hans Roehnert Frank Buschmann."— Presentation transcript:

1 Pattern Oriented Software Architecture for Networked Objects Based on the book By Douglas Schmidt Michael Stal Hans Roehnert Frank Buschmann

2 Scope of application of patterns for Networking and Distributed Systems Applications to “middleware” development. Applications to higher and lower-level systems and applications not based directly on middleware. As hardware capacity and sophistication increases, software needs to keep up. Decrease complexity of the process of software development for complex networks and services. Continuous reinvention of core concepts leads to changes in the underlying software components. Object – oriented approach leads to the modular approach and faster development.

3 Four important aspects of Networked Application Development Service Access and Configuration - Effectively design and configure application access to the system interface and implementation of evolving service components. Wrapper Façade Pattern – This design pattern shields the developer from having to interface with the low level system specific functions. Component Configurator Pattern – This allows the for the dynamic initialization and stopping of services/components. Interceptor Pattern – Allows for the handling of unexpected events into the software framework so that responses to these events can be handled at run – time. Extension Interface – This allows for the addition of extra interfaces into the applications without affecting applications itself.

4 Wrapper Façade Pattern Server Client 1.socket();6)thre_cre(); 2.bind(); 3.listen(); 5.accept(); 8.recv(); 9.write(); Handle Factory Logging Handler 4)connect(); send(); Prototype for short throw-away types of applications

5 Class Wrapper Facade Responsibilty Encapsulates non-object functions And data structures with a cohesive object- oriented abstraction Collaborator -API Functions CRC card for Wrapper Façade Class

6 Application using Wrapper Façade sequence diagram

7 Known Uses of Wrapper Façade ACE – This is a set of C++ classes which allow the user to use/extend low-level system API’s. JVM and class libraries – These use the low – level system API’s.The JVM itself is a Wrapper Façade. A simple book organization system – Individual papers and books are organized into various “themes” so that the collection can be easily accessible.

8 Event Handling -It is important to have efficient event-driven applications. Two patterns which help achieve this are : Reactor pattern :- Allows event-driven applications to demultiplex and dispatch service requests from clients. Acceptor – Connector Design pattern:- Decouples the connection and initialization of co-operating services from the processing done by the services after they are connected and initialized.

9 Acceptor – Connector Pattern Problem -How to separate initialization and connection establishment from service behavior. Solution -An Acceptor waits for connection requests and dispatches them to a reactor. -A Connector initiates connection with servers and dispatches replies to a Reactor. - Acceptor and Connector decouple passive and active roles during service initialization.

10 CRC cards for Acceptor – Connector pattern Class Acceptor Responsibility -Passively connects and initializes an associated service Handler. Collaborator -Service handler. -Dispatcher - Transport Endpoint Class Connector Collaborator -Service handler. -Dispatcher - Transport Endpoint Responsibility -Actively connects and initializes an associated service Handler. Responsibility -Registers and removes event handlers and their Handles. -Runs the applications event loop. Collaborator -Handle set. -Event Handlers. -Event Demultiplexer. Class Reactor

11 Acceptor Sequence Diagram

12 Connector pattern

13 Acceptor – Connector pattern Acceptor-Connector is one of the most important of design patterns. Provides reusability – Strict separation of connection handling ensures passive/active connection establishment procedures to be written once and run in any framework. Efficiency – Can be used to establish connections with a large number of hosts asynchronously and efficiently over long-latency wide area networks. Uses 1)Web-browsers. 2) JACE – Java ACE has built – in Acceptors, Connectors and SvcHandlers to implements core aspects of the Acceptor – Connector pattern. 3) Real-life examples such as managers communicating through their secretaries. Secretaries act as acceptors/connectors, while Managers act as service handlers.

14 Putting it all together in The ACE Framework

15 Concurrency Patterns Patterns of Interest Half-Sync/Half-Async – Decouples synchronous and asynchronous service processing in concurrent systems. Monitor Object – Synchronizes concurrent method execution to ensure that only one method at time runs within an object. This also helps in scheduling processes. Eg – Readers/Writers problem.

16 Half-Sync/Half – Async Pattern Problem Two forces to be resolved during the software development process 1)Synchronous processing simplicity and asynchronous processing complexity (and efficiency) 2)Architectures must be able to exploit both the efficiency of asynchronous operations and the simplicity of synchronous operations. Solution Separate synchronous and asynchronous layers. Synchronous operations such as file transfers,write() and read() operations are done in the synchronous layers. If these two layers need to communicate, then they do so through messages that are queued up in the queuing layer

17 Synch Service1Synch Service2Synch Service3 Queue Async Service External Event Source Queueing layer Synch Service layer Asynch Service layer

18 Synchronization Patterns Strategized Locking – Parameterized synchronization patterns that protect a component’s critical sections from concurrent access. Uses – File cache access. Eg. File access may be required by many applications at once. Many applications may require access to the file cache. The component (file cache) must contain multiple synchronization mechanisms to support various applications that implement different synchronization primitives.

19 CRC cards CRC cards are a method to simplify object- oriented programming Each card explains a class,its responsibilities and its collaborators. Each member of the design team has a card or a set of cards for which he/she is responsible.

20 Important links for Networking patterns ACE – The Adaptive Communications Environment - http://www.cs.wustl.edu/~schmidt/ACE.htmlhttp://www.cs.wustl.edu/~schmidt/ACE.html JACE ( JAVA ACE) – A set of reusable classes which are widely used for the development of networking software. - http://www.cs.wustl.edu/~schmidt/ACE-overview.htmlhttp://www.cs.wustl.edu/~schmidt/ACE-overview.html Documentation - http://www.cs.wustl.edu/~schmidt/ACE-documentation.html ACE applied to CORBA – A description and few tutorials on the ACE appiled to ORB - http://www.cs.wustl.edu/~schmidt/TAO.htmlhttp://www.cs.wustl.edu/~schmidt/TAO.html

21 To Summarize Patterns help in tapping the knowledge of software development. Patterns applied to networking simplify the process of software development. Further developments Patterns can be combined together to give pattern languages eg. Reactor – Acceptor – Connector. Reactor Acceptor-Connector Active Object Monitor Object

22 Conclusion contd.. Pattern languages ?? A pattern language guides a designer by providing workable solutions to all of the problems known to arise in the course of design. A solution is arrived at by combining a set of patterns to solve commonly encountered problem. Alternatively,if we observe a set of patterns being always used in a particular context,then we can say that we have a pattern language for that context. An example of applying pattern languages (using Acceptor- Connector-Reactor) for solving a class of problems (network routing) is described here. http://www.cs.wustl.edu/~schmidt/PDF/TAPOS-00.pdf


Download ppt "Pattern Oriented Software Architecture for Networked Objects Based on the book By Douglas Schmidt Michael Stal Hans Roehnert Frank Buschmann."

Similar presentations


Ads by Google