Track 1: Summary Slides for POSA2 Patterns and Frameworks Distributed Real-Time Systems (TI-DRTS) Version: 14-12-2009.

Slides:



Advertisements
Similar presentations
COM vs. CORBA.
Advertisements

Dr. Douglas C. Schmidt Professor of EECS Vanderbilt University Nashville, Tennessee Networked.
II. Middleware for Distributed Systems
Concurency and synchronisation patterns based on Pattern-Oriented Software Architecture, Patterns for Concurrent and Networked Objects, Volume 2 by Douglas.
Common Object Request Broker Architecture (CORBA) By: Sunil Gopinath David Watkins.
Broker Pattern Pattern-Oriented Software Architecture (POSA 1)
CORBA - Common Object Request Broker Architecture.
Pattern-Oriented Software Architecture Concurrent & Networked Objects Friday, May 22, 2015 Dr. Douglas C. Schmidt
1 Present solutions to common software problems arising within a certain context Overview of Patterns Capture recurring structures & dynamics among software.
Seminarium on Component-based Software Engineering Jan Willem Klinkenberg CORBA.
Persistent State Service 1 Performance, Scalability and Management  Topic  Refining the object model  Threading models  Distributed callbacks  Iterators.
A brief look at CORBA. What is CORBA Common Object Request Broker Architecture developed by OMG Combine benefits of OO and distributed computing Distributed.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 5: Threads Overview Multithreading Models Threading Issues Pthreads Solaris.
Seyed Mohammad Ghaffarian ( ) Computer Engineering Department Amirkabir University of Technology Fall 2010.
CORBA Case Study By Jeffrey Oliver March March 17, 2003CORBA Case Study by J. T. Oliver2 History The CORBA (Common Object Request Broker Architecture)
Server Architecture Models Operating Systems Hebrew University Spring 2004.
Performance Management 1 Performance, Scalability and Management  Topic  Refining the object model  Threading models  Distributed callbacks  Iterators.
Pattern-Oriented Software Architecture Pattern-Oriented Software Architecture Applying Concurrent & Networked Objects to Develop & Use Distributed Object.
Behavioral Patterns  Behavioral patterns are patterns whose purpose is to facilitate the work of algorithmic calculations and communication between classes.
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
COM vs. CORBA Computer Science at Azusa Pacific University September 19, 2015 Azusa Pacific University, Azusa, CA 91702, Tel: (800) Department.
Pattern Oriented Software Architecture for Networked Objects Based on the book By Douglas Schmidt Michael Stal Hans Roehnert Frank Buschmann.
Cli/Serv.: rmiCORBA/131 Client/Server Distributed Systems v Objectives –introduce rmi and CORBA , Semester 1, RMI and CORBA.
Wireless Access and Terminal Mobility in CORBA Dimple Kaul, Arundhati Kogekar, Stoyan Paunov.
CS291 Software Design Studio Dr. Douglas C. Schmidt Professor of EECS Vanderbilt University.
A Revolutionary Programming Pattern that Will Clean up your Code : Coroutines in C++ David Sackstein ACCU 2015.
Information Management NTU Interprocess Communication and Middleware.
Patterns in programming 1. What are patterns? “A design pattern is a general, reusable solution to a commonly occurring problem in software. A design.
111 © 2002, Cisco Systems, Inc. All rights reserved.
E81 CSE 532S: Advanced Multi-Paradigm Software Development Venkita Subramonian, Christopher Gill, Guandong Wang, Zhenning Hu, Zhenghui Xie Department of.
Professor of EECS Vanderbilt University Nashville, Tennessee
Proactor Pattern Venkita Subramonian & Christopher Gill
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Abhishek Bachchan Vishal Patangia
CORBA IS 8030 – Integrated Computing Environments Dr. Hoganson CORBA Common Object Request Broker Architecture Published by Object Management Group (OMG)
SCALABLE EVOLUTION OF HIGHLY AVAILABLE SYSTEMS BY ABHISHEK ASOKAN 8/6/2004.
Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du.
Architectural pattern: Interceptor Source: POSA II pp 109 – 140POSA II Environment: developing frameworks that can be extended transparently Recurring.
Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.
Pattern-Oriented Software Architectures Patterns & Frameworks for Concurrent & Distributed Systems Dr. Douglas C. Schmidt
Dynamic Architectures (Component Reconfiguration) with Fractal.
Patterns in programming1. 2 What are patterns? Answers to common design problems. A language used by developers –To discuss answers to design problems.
CORBA Overview Distributed Systems &Middleware ICS243f 22 November 2015 Arvind S. Krishna Info & Comp Science Dept University of California, Irvine
Distributed Object Frameworks DCE and CORBA. Distributed Computing Environment (DCE) Architecture proposed by OSF Goal: to standardize an open UNIX envt.
CORBA Common Object Request Broker Architecture. Basic Architecture A distributed objects architecture. Logically, an object client makes method calls.
Update on CORBA Support for Babel RMI Nanbor Wang and Roopa Pundaleeka Tech-X Corporation Boulder, CO Funded by DOE OASCR SBIR.
Electronic Payment Systems (1)
Netprog: Corba Object Services1 CORBA 2.0 Object Services Ref: The Essential Distributed Objects Survival Guide: Orfali, Harky & Edwards.
Shuman Guo CSc 8320 Advanced Operating Systems
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 13. Review Shared Data Software Architectures – Black board Style architecture.
Architectural pattern: Reactor Source: POSA II pp 179 – 214POSA II Environment: an application that receives multiple requests simultaneously but may process.
Developing Applications with the CSI Framework A General Guide.
12 Chapter 12: Advanced Topics in Object-Oriented Design Systems Analysis and Design in a Changing World, 3 rd Edition.
Developing Adaptable Software Architectures for Real-Time Systems Using Design Patterns Lawrence Chung, Kendra Cooper, Anna Yi The University of Texas.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Interceptor CS562 Spring 2002 Jan Anand Krishnan Morgan Deters Venkita Subramonian.
E81 CSE 532S: Advanced Multi-Paradigm Software Development Venkita Subramonian, Christopher Gill, Ying Huang, Marc Sentany Department of Computer Science.
4.1 Introduction to Threads Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads.
SPL/2010 Reactor Design Pattern 1. SPL/2010 Overview ● blocking sockets - impact on server scalability. ● non-blocking IO in Java - java.niopackage ●
Data Sharing Service Kiran Devaram Samatha Gangapuram Harish Maringanti Prashant Shanti Kumar Pradeep Tallogu.
Benefits & Limitations of Patterns & Frameworks: Part 1 Douglas C. Schmidt Professor of Computer.
Component Configurator
Software Design Refinement Using Design Patterns
CORBA Overview Arvind S. Krishna Info & Comp Science Dept
Event Handling Patterns Asynchronous Completion Token
Advanced Topics in Concurrency and Reactive Programming: Asynchronous Programming Majeed Kassis.
Instructor: Dr. Hany H. Ammar
RDA3 high-level – API & architecture 26th JUNE 2013
Presentation transcript:

Track 1: Summary Slides for POSA2 Patterns and Frameworks Distributed Real-Time Systems (TI-DRTS) Version:

Slide 2 © Ingeniørhøjskolen i Århus DRTS Course Model POSA2 Patterns ACE/TAO/JAWS Frameworks General DRTS Theory POSA Pattern Exercises Medico DRTS Project Track 1 Track 2 Track 3 exercises

Slide 3 © Ingeniørhøjskolen i Århus POSA2 Pattern Categorization 1.Event Handling Patterns 2.Service Access and Configuration Patterns 3.Concurrency Patterns 4.Synchronization Patterns

Slide 4 © Ingeniørhøjskolen i Århus The POSA2 Pattern Language

Slide 5 © Ingeniørhøjskolen i Århus Wrapper Façade Abstract The Wrapper Facade Design Pattern encapsulates the functions and data provided by existing non-object-oriented APIs within more concise, robust, portable, maintainable, and cohesive object-oriented class interfaces

Slide 6 © Ingeniørhøjskolen i Århus Wrapper Façade Structure Application calls methods calls API FunctionA() calls API FunctionB() calls API FunctionC() void methodN(){ functionA(); } void method1(){ functionA(); } functionB(); Wrapper Facade data method1() … methodN()

Slide 7 © Ingeniørhøjskolen i Århus Reactor Abstract The Reactor Architectural Pattern allows event-driven applications to demultiplex & dispatch service requests that are delivered to an application from one or more clients

Slide 8 © Ingeniørhøjskolen i Århus Reactor Pattern – Structure Synchronous Event Demultiplexer +select() * 1 «uses» EventHandler + handle_event() + get_handle() Concrete EventHandlerA + handle_events() + register_handler() + remove_handler() Concrete EventHandlerB handle_event() get_handle() Handle owns Reactor handle_event() get_handle() 1 1 dispatches * 1 * 1 Application «creates»

Slide 9 © Ingeniørhøjskolen i Århus Reactor – Sequence Diagram Observations Note inversion of control Also note how long-running event handlers can degrade the QoS since callbacks steal the reactor’s thread! 1.Initialize phase 2.Event handling phase

Slide 10 © Ingeniørhøjskolen i Århus Acceptor-Connector Abstract The Acceptor-Connector Design Pattern decouples the connection and initialization of cooperating peer services in a networked system from the processing performed by the peer services after they are connected and initialized

Slide 11 © Ingeniørhøjskolen i Århus Acceptor/Connector Structure owns * uses > owns uses owns > * * * * * uses > Connector Connector() connect() complete() handle_event () Concrete Service Handler B Concrete Service Handler A Concrete Acceptor Concrete Connector Acceptor Acceptor() accept() handle_event () peer_acceptor_ Service Handler open() handle_event () set_handle() peer_stream_ Dispatcher +select() +handle_events() +register_handler() +remove_handler() Transport Handle Transport Handle Transport Handle > * * 1

Slide 12 © Ingeniørhøjskolen i Århus Acceptor Dynamics : Application: Acceptor : Dispatcher register_handler() handle_events() open() ACCEPT_ EVENT Handle1Acceptor 1. Passive-mode endpoint initialize phase 1. handle_event() service() 3. Service processing phase 3. Event

Slide 13 © Ingeniørhøjskolen i Århus Proactor Abstract The Proactor Architectural Pattern allows event-driven applications to efficiently demultiplex and dispatch service requests triggered by the completion of asynchronous operations, to achieve the performance benefits of concurrency without incurring certain of its liabilities

Slide 14 © Ingeniørhøjskolen i Århus Proactor Structure Completion Handler Concrete Completion Handler handle_event() Proactor handle_events() Asynchronous Event Demuxer get_completion_event() Asynchronous Operation Processor execute_async_operation() Completion Event Queue Asynchronous Operation async_operation() Handle «dequeues» «enqueues» «executes» «demultiplexes & dispatches» * Initiator «uses»

Slide 15 © Ingeniørhøjskolen i Århus Proactor Dynamics Completion Handler Completion :Asynchronous Operation : Proactor :Concrete Completion Handler exec_async_ :Asynchronous Operation Processor async_operation() Ev. Queue operation () :Completion Event Queue 1.Initiate operation 2.Process operation Result completion event 4. Generate & queue completion event 3. Run event loop handle_events() Result event Result handle_ service() event() 5. Dequeue completion event & perform completion processing :Initiator

Slide 16 © Ingeniørhøjskolen i Århus Asynchronous Completion Token Abstract The Asynchronous Completion Token (ACT) Design Pattern allows an application to demultiplex and process efficiently the responses of asynchronous operations it invokes on services

Slide 17 © Ingeniørhøjskolen i Århus ACT Structure Asynchronous Completion Token 0..* Initiator completion_action() 0..* Service async_operation() calls operations Completion Handler +handle_event() 1..* «uses» «demultiplexes»

Slide 18 © Ingeniørhøjskolen i Århus ACT Dynamic :Initiator :Completion Handler :Service operation() ACT notify() ACTresult completion_action() handle_event() result :ACT «create»

Slide 19 © Ingeniørhøjskolen i Århus Half-Sync/Half-Async Abstract The Half-Sync/Half-Async Architectural Pattern decouples asynchronous and synchronous service processing in concurrent systems, to simplify programming without unduly reducing performance The pattern introduces two intercommunicating layers, one for asynchronous and one for synchronous service processing

Slide 20 © Ingeniørhøjskolen i Århus Half-Sync/Half-Async Structure «dequeue/enqueue» Queue «read/write» Queueing Layer Async Service External Event Source «interrupt» Asynchronous Service Layer Sync Service 1 Sync Service 2 Sync Service 3 Synchronous Service Layer

Slide 21 © Ingeniørhøjskolen i Århus Half-Sync/Half-Async Dynamics : External Event Source : Async Service: Queue: Sync Service read() message work() notification enqueue() message notification read() message work()

Slide 22 © Ingeniørhøjskolen i Århus Active Object Abstract The Active Object Design Pattern decouples method execution from method invocation to enhance concurrency and simplify synchronized access to objects that reside in their own threads of control

Slide 23 © Ingeniørhøjskolen i Århus Active Object Structure Proxy +method_1() +method_N() Client «invoke» «write to» «obtain result from» Future «instantiate» Servant +method_1() +method_N() «execute» Method Request +can_run() +call() Concrete MethodReq1 Concrete MethodReqN «instantiate» Scheduler #dispatch() +insert() Activation List +insert() +remove() 1111 *

Slide 24 © Ingeniørhøjskolen i Århus Active Object Dynamics :Future method insert :Proxy :Scheduler :Servant :Method Request :Client dispatchcall method write 2. Method execution 1. Method request and scheduling read 3. Completion

Slide 25 © Ingeniørhøjskolen i Århus Monitor Object Abstract The Monitor Object Design Pattern synchronizes concurrent method execution to ensure that only one method at a time runs within an object. It also allows an object’s method to cooperatively schedule their execution sequences The Scoped Locking C++ Idiom ensures that a lock is acquired when control enters a scope and released automatically when control leaves the scope, regardless of the return path form the scope

Slide 26 © Ingeniørhøjskolen i Århus Monitor Object Pattern Structure ClientMonitor Object +sync_method1() +sync_methodN() 2..* Monitor Lock uses +acquire() +release() 1 * 1 Monitor Condition uses +wait() +notify() +notify_all() Needed to implement wait in a monitor

Slide 27 © Ingeniørhøjskolen i Århus Monitor Object Dynamics :Monitor Object :Monitor Lock :Monitor Condition :Client Thread2 :Client Thread1 sync_method1() acquire() dowork() sync_method2() acquire() dowork() notify() release() wait() release() dowork() release() acquire()

Slide 28 © Ingeniørhøjskolen i Århus Leader/Followers Abstract The Leader/Followers Architectural Pattern provides an efficient concurrency model where multiple threads take turns sharing a set of event sources in order to detect, demultiplex, dispatch, and process service requests that occur on the event sources

Slide 29 © Ingeniørhøjskolen i Århus Leader/Followers Structure Thread Pool join() promote_new_leader() synchronizer uses Handle * Handle Set handle_events() deactivate_handle() reactivate_handle() select() 1 demultiplexes * Event Handler handle_event() get_handle() Concrete Event Handler A Concrete Event Handler B handle_event() get_handle() handle_event() get_handle() Thread joins 1 *

Slide 30 © Ingeniørhøjskolen i Århus Thread State Chart LEADING become new leader PROCESSING new event processing completed [no current leader] FOLLOWING processing completed [there is a current leader]

Slide 31 © Ingeniørhøjskolen i Århus Leader/Followers Dynamics handle_events() new_leader() promote_

Slide 32 © Ingeniørhøjskolen i Århus Component Configurator Abstract The Component Configurator Design Pattern allows an application to link and unlink its component implementations at run-time without having to modify, recompile, or statically relink the application. Component Configurator further supports the reconfiguration of components into different application processes without having to shut down and re-start running processes.

Slide 33 © Ingeniørhøjskolen i Århus Component Configurator Structure Concrete Component A Concrete Component B Component Repository Component Configurator +insert() +remove() +find() +suspend() +resume() Component +init() +fini() +suspend() +resume() +info() * components «controls» 1 Application

Slide 34 © Ingeniørhøjskolen i Århus Component Configurator Dynamics :Component Configurator :Concrete Component A :Component Repository run_component() 2. Component processing :Concrete Component B

Slide 35 © Ingeniørhøjskolen i Århus State Chart for a Component Life Cycle IDLE fini() TERMINATE/ fini() TERMINATE/ suspend() SUSPEND/ SUSPENDED RECONFIGURE/ init() EXECUTE/ run_component() CONFIGURE/ init() RUNNING resume() RESUME/

Slide 36 © Ingeniørhøjskolen i Århus Interceptor Abstract The Interceptor Architectural Pattern allows services to be added transparently to a framework and triggered automatically when certain events occur

Slide 37 © Ingeniørhøjskolen i Århus Interceptor Structure Interceptor +event1_callback() +event2_callback() Concrete Interceptor +event1_callback() +event2_callback() Application do_work() * 1 «use» «register» «remove» * Dispatcher List of Interceptors +dispatch() +register() +remove() +iterate_list() Concrete Framework +event() +access_internals() +service() Context +set_value() +get_value() +consume_service() * «create» 1

Slide 38 © Ingeniørhøjskolen i Århus Interceptor Dynamics :Concrete Framework :Dispatcher co:Context object event() :Application ci:Concrete Interceptor register(ci) consume_ service() get_value() access_internals() event_callback(co) dispatch(co) iterate_ list()

Slide 39 © Ingeniørhøjskolen i Århus Extension Interface Abstract The Extension Interface Design Pattern allows multiple interfaces to be exported by a component, to prevent bloating of interfaces and breaking of client code when developers extend or modify the functionality of the component

Slide 40 © Ingeniørhøjskolen i Århus Extension Interface Structure * Extension Interface +service() Root Interface +getExtension() Client «invoke» Component Factory +create() +find() «instantiate» Component +service() -implementation() «new»

Slide 41 © Ingeniørhøjskolen i Århus Extension Interface Dynamics (1) :Client :Component Factory :Imp. Extension Interface create() Interface ID :Component getExtension() Interface ID Interface

Slide 42 © Ingeniørhøjskolen i Århus Extension Interface Dynamics (2) :Client :Imp. Extension Interface A service1() getExtension() Interface ID B Interface B :Imp. Extension Interface B service2()

Slide 43 © Ingeniørhøjskolen i Århus Thread-Specific Storage Abstract The Thread-Specific Storage Design Pattern allows multiple threads to use one ‘logically global’ access point to retrieve an object that is local to a thread, without incurring the locking overhead on each object access

Slide 44 © Ingeniørhøjskolen i Århus Thread-Specific Storage Structure Application Thread Key Factory +create_key() 1 Thread-Specific Object Set +get(key) +set(key, object) threadId {0..m} 0..1 Thread-Specific Object Proxy -key «uses» +method1().. +methodN() 0..m 0..n Thread-Specific Object +method1().. +methodN() maintains key 0..1 {0..n}

Slide 45 © Ingeniørhøjskolen i Århus Thread-Specific Storage Dynamics (1) :Application Thread :ThreadSpecific ObjectProxy :ThreadSpecific ObjectSet :Key Factory method() createKey() key ts :ThreadSpecific Object create () set() tskey method()

Slide 46 © Ingeniørhøjskolen i Århus Thread-Specific Storage Dynamics (2) :Application Thread :ThreadSpecific ObjectProxy :ThreadSpecific ObjectSet ts :ThreadSpecific Object get() key ts method() result

Slide 47 © Ingeniørhøjskolen i Århus Overview of the ACE Framework

Slide 48 © Ingeniørhøjskolen i Århus TAO (The Ace Orb) TAO is a high-performance real-time ORB endsystem TAO supports: –the standard OMG CORBA reference model –the Real-Time CORBA specification –enhancements for predictable, and scalable QoS for high-performance and real-time applications

Slide 49 © Ingeniørhøjskolen i Århus Components in the TAO Real-time ORB Endsystem

Slide 50 © Ingeniørhøjskolen i Århus Applying a Pattern Language to TAO POSA2 & GoF Patterns IDL Stub IDL Skeleton

Slide 51 © Ingeniørhøjskolen i Århus Using the Reactor Pattern in TAO’s Event Loop GIOP Solution – the Reactor Pattern: An effective way to reduce coupling and increase the extensibility of an ORB core

Slide 52 © Ingeniørhøjskolen i Århus Using the Acceptor-Connector in TAO’s Connection Management TAO’s Acceptors and Connectors can be configured with any transport mechanisms and with custom concurrency strategies

Slide 53 © Ingeniørhøjskolen i Århus Using the Leader/Followers Pattern in TAO Running GIOP Connection Handlers Solution: Leader/Followers An efficient concurrency model

Slide 54 © Ingeniørhøjskolen i Århus Using the Component Configurator Pattern in TAO

Slide 55 © Ingeniørhøjskolen i Århus JAWS High-performance Web Server called JAWS JAWS is both a Web Server and a Framework from which other types of serves can be built JAWS was developed using the ACE Framework

Slide 56 © Ingeniørhøjskolen i Århus Architectural Overview of JAWS

Slide 57 © Ingeniørhøjskolen i Århus JAWS Web Server Framework