SlideShare a Scribd company logo
1 of 19
Architectural Patterns
[PART 2]
Architectural Patterns
Interactive System Patterns – It describes architecture that
support the adaptation of user interface parts without causing
major effect to Application specific functionality or the
underlying data model.
• Model-View-Controller
Model-View-Controller
This pattern can be used to divide system’s task to three
different components - Model, View and Controller.
• Model contains the core functionality and data. It is
independent of the data received or presented in the views.
There can be multiple view for same Model.
• View displays information to the user. It may allow user to
edit the data from the application’s model.
• Controller handles user input. It can also perform set-up and
coordinating tasks for an application.
Views and Controllers together comprise the user interface.
A change-propagation mechanism (e.g. Subscriber-obsever)
ensures consistency between the user interface and the model.
Model-View-Controller
Example – Web browser
Invoke
Result

Request

HTTP
Browser
(User)

Response

Model

Servlet
(Controller)

JSP
(View)

Database
Architectural Patterns
Event Handling Patterns – It describes how to initiate, receive,
demultiplex, dispatch and process events in networked systems.
• Proactor
• Reactor
• Asynchronous Completion Token
• Acceptor-Connector
Proactor
This pattern can be used for the demultiplexing and dispatching
of multiple event handlers which are triggered by the completion
of asynchronous events.
It requires a dedicated thread for each connected client.
In this pattern application issues an asynchronous operation to
the OS and registers a callback with a Completion Dispatcher
that will notify the Application when the operation completes.
The OS then performs the operation on behalf of the application
and subsequently queues the result in a well-known location.
The Completion Dispatcher is responsible for dequeueing
completion notifications and executing the appropriate
callback that contains application-specific code.
Proactor
Client
(Web Server)

OS

Completion
Despatcher

HTTP Get request
Read complete

Handler

File
System

Read complete
Parse
request
Read File(sync)

Write file data to client connection
(Async)
Write complete
Write complete
Proactor
Components –
Proactive Initiator: Any entity in the application that initiates an
Asynchronous Operation. The Proactive Initiator registers a Completion
Handler and a Completion Dispatcher with a Asynchronous Operation
Processor, which notifies it when the operation completes.
Completion Handler (Acceptor ) : interfaces that are implemented by
the application for Asynchronous Operation completion notification.
Asynchronous Operations : it is used to execute requests (such as I/O
and timer operations) on behalf of applications.
Asynchronous Operation Processor : When Asynchronous Operations
complete, the Asynchronous Operation Processor delegates application
notifications to a Completion Dispatcher
Completion Dispatcher (the Notification Queue) : it is responsible for
calling back to the application’s Completion Handlers when
Asynchronous Operations complete.
Reactor
This can be used for handling service requests delivered concurrently to a
service handler by one or more clients by demultiplexes and despathching
the incoming requests to the associated request handlers.
A reactor defines an interface that allows applications to register or remove
event handlers and their associated handles, and run the application's event
loop. It uses its synchronous event demultiplexer to wait for indication events
to occur on its handle set. When this occurs, the reactor first demultiplexes
each indication event from the handle on which it occurs to its associated
event handler. Then it dispatches the appropriate hook method on the
handler to process the event.
Reactor pattern can not support many simultaneous users and/or longduration user requests as it serializes all processing at the event
demultiplexing layer. As a result only one request can be dispatched and
processed iteratively at any given time.
Reactor
Components –
Resources: Any resource that can provide input to or consume
output from the system.
Synchronous Event Demultiplexer: Uses an event loop to block
on all resources. When it is possible to start a synchronous
operation on a resource without blocking, the demultiplexer
sends the resource to the dispatcher.
Dispatcher: Handles registering and unregistering of request
handlers. Dispatches resources from the demultiplexer to the
associated request handler.
Request Handler: An application defined request handler and its
associated resource
Reactor
Client

Reactor

Demultiplexer

Instantiate event handler
register event handler
Select(…)
handles

Dispatch

handleEvent(…)

Demultiplex

handleEvents()

EventHandler
Asynchronous Completion Token
This pattern can be used to demultiplex and process
efficiently the responses of asynchronous operations
it invokes on services.
• For every asynchronous operation that a client
invokes on a service, an asynchronous completion
token (ACT) is created and Passed to the service
together with the operation, which holds but does
not modify the ACT.
• When the service replies to the initiator, its
response includes the ACT that was sent originally.
• The initiator can then use the ACT to identify the
completion handler that will process the response
from the original asynchronous operation
Asynchronous Completion Token
ACT – It contains information that uniquely identifies the
completion handler, which is the function or object responsible
for processing the operation's response.
Components –
Service - Provides functionality that can be accessed
asynchronously.
Completion handler – It is a function or object within an
application that is responsible for processing service responses.
Client initiator - Invokes operations on a service asynchronously.
It also demultiplexes the response returned by these operations
to a designated completion handler.
Asynchronous Completion Token
Client
Initiator

Completion
Handler

ACT

Create an ACT
Invoke a service including ACT
Do some other operation /
Process response from other services
Response including same ACT
Completion_Action

Process Result

Service
Acceptor-Connector
This pattern can be used to decouple service tasks
performed by a service from the steps required to initialize
the service.
It is beneficial for an application which receives a large
number of concurrent connections with peers residing
across long-latency networks and not able to perform
blocking or continuous polling for incoming connections on
any individual peer due to latency.
Components Reactor - The Reactor allows multiple Acceptors to listen
for connections from different peers efficiently within a
single thread of control. The Reactor allows multiple Service
Handlers to have their connections initiated and completed
asynchronously by a Connector configured within a single
thread of control.
Acceptor-Connector
Service Handler It contains a communication endpoint (peer stream ) that encapsulates an I/O handle
(I/O descriptor). This endpoint is initialized by the Acceptor/Connector and is
subsequently used by the Service Handler to exchange data with its connected peer.
Acceptor This implements the strategy for passively initializing a Service Handler which
communicates with the peer. The Reactor calls back to the Acceptor’s accept method
when a connection arrives on the passive-mode peer acceptor endpoint. The accept
method uses this passive-mode endpoint to accept connections into the Service
Handler’s peer stream and then activate a Service Handler.
Connector This implements the strategy for actively initializing a Service Handler which
communicates with the peer. The Connector activates a connected Service after
initialization is complete. The complete method finishes activating Service Handlers
whose connections were initiated and completed asynchronously. the Reactor calls
back the complete method automatically when an asynchronous connection is
established.
Acceptor
Acceptor component initialization and service processing : Server

Acceptor

Initialize end points

Service
Handler

Reactor

Register handler
Get handle

Handle events ( Loop for events)
Handle Connection Event
Create and Register Service handler
Register handler for Client I/O
Initialization Complete and ready for service processing
Get handle
Handle Data Event

Service (process msg)
Connector
Acceptor component initialization and service processing : Server

Acceptor

Initiate connection

Service
Handler

Reactor

Register handler

Handle events ( Loop for events)
Handle Connection event
Connection Complete
Perform service-specific initialization
Register service handler
Initialization Complete and ready for service processing
Get handle
Handle Data Event

Service (process msg)
Thank You

Your suggestions and comments are always welcome.
Please send me your feedback at
a_s_sinha@yahoo.com

More Related Content

What's hot

Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12koolkampus
 
Architectural patterns part 1
Architectural patterns part 1Architectural patterns part 1
Architectural patterns part 1assinha
 
Unit 5- Architectural Design in software engineering
Unit 5- Architectural Design in software engineering Unit 5- Architectural Design in software engineering
Unit 5- Architectural Design in software engineering arvind pandey
 
Requirements analysis and modeling
Requirements analysis and modelingRequirements analysis and modeling
Requirements analysis and modelingSyed Zaid Irshad
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modelingramyaaswin
 
Unit 3(advanced state modeling & interaction meodelling)
Unit  3(advanced state modeling & interaction meodelling)Unit  3(advanced state modeling & interaction meodelling)
Unit 3(advanced state modeling & interaction meodelling)Manoj Reddy
 
Software Design and Modularity
Software Design and ModularitySoftware Design and Modularity
Software Design and ModularityDanyal Ahmad
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSAshita Agrawal
 
Software development life cycle (SDLC)
Software development life cycle (SDLC)Software development life cycle (SDLC)
Software development life cycle (SDLC)Simran Kaur
 
Object Modeling Techniques
Object Modeling TechniquesObject Modeling Techniques
Object Modeling TechniquesShilpa Wadhwani
 
Software Quality Assurance
Software Quality AssuranceSoftware Quality Assurance
Software Quality AssuranceSaqib Raza
 
Requirements modeling
Requirements modelingRequirements modeling
Requirements modelingAnanthiP8
 
line attributes.pptx
line attributes.pptxline attributes.pptx
line attributes.pptxRubaNagarajan
 
Transaction management in DBMS
Transaction management in DBMSTransaction management in DBMS
Transaction management in DBMSMegha Sharma
 
Pressman ch-3-prescriptive-process-models
Pressman ch-3-prescriptive-process-modelsPressman ch-3-prescriptive-process-models
Pressman ch-3-prescriptive-process-modelszeal123123
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management SystemJanki Shah
 
Software Development Life Cycle
Software Development Life CycleSoftware Development Life Cycle
Software Development Life CycleSlideshare
 

What's hot (20)

Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12
 
Architectural patterns part 1
Architectural patterns part 1Architectural patterns part 1
Architectural patterns part 1
 
Unit 5- Architectural Design in software engineering
Unit 5- Architectural Design in software engineering Unit 5- Architectural Design in software engineering
Unit 5- Architectural Design in software engineering
 
Requirements analysis and modeling
Requirements analysis and modelingRequirements analysis and modeling
Requirements analysis and modeling
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modeling
 
Unit 3(advanced state modeling & interaction meodelling)
Unit  3(advanced state modeling & interaction meodelling)Unit  3(advanced state modeling & interaction meodelling)
Unit 3(advanced state modeling & interaction meodelling)
 
Software Design and Modularity
Software Design and ModularitySoftware Design and Modularity
Software Design and Modularity
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMS
 
Oomd unit1
Oomd unit1Oomd unit1
Oomd unit1
 
Software development life cycle (SDLC)
Software development life cycle (SDLC)Software development life cycle (SDLC)
Software development life cycle (SDLC)
 
Object Modeling Techniques
Object Modeling TechniquesObject Modeling Techniques
Object Modeling Techniques
 
Software Quality Assurance
Software Quality AssuranceSoftware Quality Assurance
Software Quality Assurance
 
Requirements modeling
Requirements modelingRequirements modeling
Requirements modeling
 
line attributes.pptx
line attributes.pptxline attributes.pptx
line attributes.pptx
 
Transaction management in DBMS
Transaction management in DBMSTransaction management in DBMS
Transaction management in DBMS
 
Pressman ch-3-prescriptive-process-models
Pressman ch-3-prescriptive-process-modelsPressman ch-3-prescriptive-process-models
Pressman ch-3-prescriptive-process-models
 
Cohesion and coupling
Cohesion and couplingCohesion and coupling
Cohesion and coupling
 
Types and roles
Types and rolesTypes and roles
Types and roles
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
Software Development Life Cycle
Software Development Life CycleSoftware Development Life Cycle
Software Development Life Cycle
 

Viewers also liked

2. how does your media product represent particular social groups
2. how does your media product represent particular social groups2. how does your media product represent particular social groups
2. how does your media product represent particular social groupswownoway
 
50 Days of ideas to use with theUltranet Message Boards
50 Days of ideas to use with theUltranet Message Boards50 Days of ideas to use with theUltranet Message Boards
50 Days of ideas to use with theUltranet Message Boardsdmgregg
 
Preparing for the Worst: Disaster Planning at the Art, Architecture, and Engi...
Preparing for the Worst: Disaster Planning at the Art, Architecture, and Engi...Preparing for the Worst: Disaster Planning at the Art, Architecture, and Engi...
Preparing for the Worst: Disaster Planning at the Art, Architecture, and Engi...frankrd
 
Desaster Mgt
Desaster MgtDesaster Mgt
Desaster MgtMADAN PANDIA
 
D.R.I.P.S, LLC.
D.R.I.P.S, LLC.D.R.I.P.S, LLC.
D.R.I.P.S, LLC.bigbagsusa
 
Distributed Systems Architecture in Software Engineering SE11
Distributed Systems Architecture in Software Engineering SE11Distributed Systems Architecture in Software Engineering SE11
Distributed Systems Architecture in Software Engineering SE11koolkampus
 
Natural Disasters Lecture 1 (Introduction)
Natural Disasters Lecture 1 (Introduction)Natural Disasters Lecture 1 (Introduction)
Natural Disasters Lecture 1 (Introduction)William W. Little
 
Site analysis parameters
Site analysis  parametersSite analysis  parameters
Site analysis parametersNagappan Annamalai
 
Greg Young on Architectural Innovation: Eventing, Event Sourcing
Greg Young on Architectural Innovation: Eventing, Event SourcingGreg Young on Architectural Innovation: Eventing, Event Sourcing
Greg Young on Architectural Innovation: Eventing, Event SourcingSkills Matter
 
Timeline Of Modernist Architecture 30.11.2009
Timeline Of Modernist Architecture 30.11.2009Timeline Of Modernist Architecture 30.11.2009
Timeline Of Modernist Architecture 30.11.2009mauritz_leon_kruger1
 
Architecture as a Catalyst for Sustainable Development, Anna HERINGER
Architecture as a Catalyst for Sustainable Development, Anna HERINGERArchitecture as a Catalyst for Sustainable Development, Anna HERINGER
Architecture as a Catalyst for Sustainable Development, Anna HERINGERGlobal Risk Forum GRFDavos
 
A Holistic Approach Towards International Disaster Resilient Architecture by ...
A Holistic Approach Towards International Disaster Resilient Architecture by ...A Holistic Approach Towards International Disaster Resilient Architecture by ...
A Holistic Approach Towards International Disaster Resilient Architecture by ...Global Risk Forum GRFDavos
 
Types of natural disasters tam-2014-01
Types of natural disasters   tam-2014-01Types of natural disasters   tam-2014-01
Types of natural disasters tam-2014-01Vijay Kumar
 
Kohinoor Hospital the Sustainable Hospital
Kohinoor Hospital the Sustainable HospitalKohinoor Hospital the Sustainable Hospital
Kohinoor Hospital the Sustainable HospitalRajat Katarne
 
Earthquake and earthquake resistant design
Earthquake and earthquake resistant designEarthquake and earthquake resistant design
Earthquake and earthquake resistant designSatish Kambaliya
 
Case study
Case studyCase study
Case studyRaj Kumar
 
Earthquake resistant construction
Earthquake resistant constructionEarthquake resistant construction
Earthquake resistant constructionHarsh Jain
 
Apollo Hospital case study
Apollo Hospital case studyApollo Hospital case study
Apollo Hospital case studyPulkit Yadav
 
Hospital project report
Hospital project reportHospital project report
Hospital project reportjssclinic
 
Natural disasters' Impacts & Prevention
Natural disasters' Impacts & PreventionNatural disasters' Impacts & Prevention
Natural disasters' Impacts & PreventionKatie Chan
 

Viewers also liked (20)

2. how does your media product represent particular social groups
2. how does your media product represent particular social groups2. how does your media product represent particular social groups
2. how does your media product represent particular social groups
 
50 Days of ideas to use with theUltranet Message Boards
50 Days of ideas to use with theUltranet Message Boards50 Days of ideas to use with theUltranet Message Boards
50 Days of ideas to use with theUltranet Message Boards
 
Preparing for the Worst: Disaster Planning at the Art, Architecture, and Engi...
Preparing for the Worst: Disaster Planning at the Art, Architecture, and Engi...Preparing for the Worst: Disaster Planning at the Art, Architecture, and Engi...
Preparing for the Worst: Disaster Planning at the Art, Architecture, and Engi...
 
Desaster Mgt
Desaster MgtDesaster Mgt
Desaster Mgt
 
D.R.I.P.S, LLC.
D.R.I.P.S, LLC.D.R.I.P.S, LLC.
D.R.I.P.S, LLC.
 
Distributed Systems Architecture in Software Engineering SE11
Distributed Systems Architecture in Software Engineering SE11Distributed Systems Architecture in Software Engineering SE11
Distributed Systems Architecture in Software Engineering SE11
 
Natural Disasters Lecture 1 (Introduction)
Natural Disasters Lecture 1 (Introduction)Natural Disasters Lecture 1 (Introduction)
Natural Disasters Lecture 1 (Introduction)
 
Site analysis parameters
Site analysis  parametersSite analysis  parameters
Site analysis parameters
 
Greg Young on Architectural Innovation: Eventing, Event Sourcing
Greg Young on Architectural Innovation: Eventing, Event SourcingGreg Young on Architectural Innovation: Eventing, Event Sourcing
Greg Young on Architectural Innovation: Eventing, Event Sourcing
 
Timeline Of Modernist Architecture 30.11.2009
Timeline Of Modernist Architecture 30.11.2009Timeline Of Modernist Architecture 30.11.2009
Timeline Of Modernist Architecture 30.11.2009
 
Architecture as a Catalyst for Sustainable Development, Anna HERINGER
Architecture as a Catalyst for Sustainable Development, Anna HERINGERArchitecture as a Catalyst for Sustainable Development, Anna HERINGER
Architecture as a Catalyst for Sustainable Development, Anna HERINGER
 
A Holistic Approach Towards International Disaster Resilient Architecture by ...
A Holistic Approach Towards International Disaster Resilient Architecture by ...A Holistic Approach Towards International Disaster Resilient Architecture by ...
A Holistic Approach Towards International Disaster Resilient Architecture by ...
 
Types of natural disasters tam-2014-01
Types of natural disasters   tam-2014-01Types of natural disasters   tam-2014-01
Types of natural disasters tam-2014-01
 
Kohinoor Hospital the Sustainable Hospital
Kohinoor Hospital the Sustainable HospitalKohinoor Hospital the Sustainable Hospital
Kohinoor Hospital the Sustainable Hospital
 
Earthquake and earthquake resistant design
Earthquake and earthquake resistant designEarthquake and earthquake resistant design
Earthquake and earthquake resistant design
 
Case study
Case studyCase study
Case study
 
Earthquake resistant construction
Earthquake resistant constructionEarthquake resistant construction
Earthquake resistant construction
 
Apollo Hospital case study
Apollo Hospital case studyApollo Hospital case study
Apollo Hospital case study
 
Hospital project report
Hospital project reportHospital project report
Hospital project report
 
Natural disasters' Impacts & Prevention
Natural disasters' Impacts & PreventionNatural disasters' Impacts & Prevention
Natural disasters' Impacts & Prevention
 

Similar to Architectural Patterns - Interactive and Event Handling Patterns

Design patterns - ICIN 2010
Design patterns - ICIN 2010Design patterns - ICIN 2010
Design patterns - ICIN 2010steccami
 
24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMSkoolkampus
 
Multi-service reactive streams using Spring, Reactor, RSocket
Multi-service reactive streams using Spring, Reactor, RSocketMulti-service reactive streams using Spring, Reactor, RSocket
Multi-service reactive streams using Spring, Reactor, RSocketStéphane Maldini
 
Functional reactive programming
Functional reactive programmingFunctional reactive programming
Functional reactive programmingAraf Karsh Hamid
 
Restate: Event-driven Asynchronous Services, Easy as Synchronous RPC
Restate: Event-driven Asynchronous Services, Easy as Synchronous RPCRestate: Event-driven Asynchronous Services, Easy as Synchronous RPC
Restate: Event-driven Asynchronous Services, Easy as Synchronous RPCHostedbyConfluent
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systemsguest61205606
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systemsguest61205606
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systemsguest0f5a7d
 
Guide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxGuide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxInexture Solutions
 
iiwas 2010
iiwas 2010iiwas 2010
iiwas 2010steccami
 
Servlets - filter, listeners, wrapper, internationalization
Servlets -  filter, listeners, wrapper, internationalizationServlets -  filter, listeners, wrapper, internationalization
Servlets - filter, listeners, wrapper, internationalizationsusant sahu
 
Architectural patterns part 4
Architectural patterns part 4Architectural patterns part 4
Architectural patterns part 4assinha
 
Introduction to reactive programming
Introduction to reactive programmingIntroduction to reactive programming
Introduction to reactive programmingLeapfrog Technology Inc.
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices ArchitectureIdan Fridman
 
Reactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactorReactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactorOrenEzer1
 
Architecture for monitoring applications in Cloud
Architecture for monitoring applications in CloudArchitecture for monitoring applications in Cloud
Architecture for monitoring applications in CloudOnkar Kadam
 
Middleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMIMiddleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMIPrajakta Rane
 

Similar to Architectural Patterns - Interactive and Event Handling Patterns (20)

Design patterns - ICIN 2010
Design patterns - ICIN 2010Design patterns - ICIN 2010
Design patterns - ICIN 2010
 
Remoting and serialization
Remoting and serializationRemoting and serialization
Remoting and serialization
 
Reactors.io
Reactors.ioReactors.io
Reactors.io
 
24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS
 
Multi-service reactive streams using Spring, Reactor, RSocket
Multi-service reactive streams using Spring, Reactor, RSocketMulti-service reactive streams using Spring, Reactor, RSocket
Multi-service reactive streams using Spring, Reactor, RSocket
 
Listeners and filters in servlet
Listeners and filters in servletListeners and filters in servlet
Listeners and filters in servlet
 
Functional reactive programming
Functional reactive programmingFunctional reactive programming
Functional reactive programming
 
Restate: Event-driven Asynchronous Services, Easy as Synchronous RPC
Restate: Event-driven Asynchronous Services, Easy as Synchronous RPCRestate: Event-driven Asynchronous Services, Easy as Synchronous RPC
Restate: Event-driven Asynchronous Services, Easy as Synchronous RPC
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 
Guide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxGuide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFlux
 
iiwas 2010
iiwas 2010iiwas 2010
iiwas 2010
 
Servlets - filter, listeners, wrapper, internationalization
Servlets -  filter, listeners, wrapper, internationalizationServlets -  filter, listeners, wrapper, internationalization
Servlets - filter, listeners, wrapper, internationalization
 
Architectural patterns part 4
Architectural patterns part 4Architectural patterns part 4
Architectural patterns part 4
 
Introduction to reactive programming
Introduction to reactive programmingIntroduction to reactive programming
Introduction to reactive programming
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices Architecture
 
Reactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactorReactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactor
 
Architecture for monitoring applications in Cloud
Architecture for monitoring applications in CloudArchitecture for monitoring applications in Cloud
Architecture for monitoring applications in Cloud
 
Middleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMIMiddleware in Distributed System-RPC,RMI
Middleware in Distributed System-RPC,RMI
 

More from assinha

Nwe Embodiment (Naba Kalebara) of Lord Jagannath of PURI - The Greatest and B...
Nwe Embodiment (Naba Kalebara) of Lord Jagannath of PURI - The Greatest and B...Nwe Embodiment (Naba Kalebara) of Lord Jagannath of PURI - The Greatest and B...
Nwe Embodiment (Naba Kalebara) of Lord Jagannath of PURI - The Greatest and B...assinha
 
SNMP AT a GLANCE
SNMP AT a GLANCESNMP AT a GLANCE
SNMP AT a GLANCEassinha
 
Layer3protocols
Layer3protocolsLayer3protocols
Layer3protocolsassinha
 
Umts explained
Umts explainedUmts explained
Umts explainedassinha
 
Architectural patterns part 3
Architectural patterns part 3Architectural patterns part 3
Architectural patterns part 3assinha
 
Data Structures used in Linux kernel
Data Structures used in Linux kernel Data Structures used in Linux kernel
Data Structures used in Linux kernel assinha
 
E nodeb handover procedure
E nodeb handover procedureE nodeb handover procedure
E nodeb handover procedureassinha
 
Initial LTE call Setup Flow
Initial LTE call Setup FlowInitial LTE call Setup Flow
Initial LTE call Setup Flowassinha
 

More from assinha (8)

Nwe Embodiment (Naba Kalebara) of Lord Jagannath of PURI - The Greatest and B...
Nwe Embodiment (Naba Kalebara) of Lord Jagannath of PURI - The Greatest and B...Nwe Embodiment (Naba Kalebara) of Lord Jagannath of PURI - The Greatest and B...
Nwe Embodiment (Naba Kalebara) of Lord Jagannath of PURI - The Greatest and B...
 
SNMP AT a GLANCE
SNMP AT a GLANCESNMP AT a GLANCE
SNMP AT a GLANCE
 
Layer3protocols
Layer3protocolsLayer3protocols
Layer3protocols
 
Umts explained
Umts explainedUmts explained
Umts explained
 
Architectural patterns part 3
Architectural patterns part 3Architectural patterns part 3
Architectural patterns part 3
 
Data Structures used in Linux kernel
Data Structures used in Linux kernel Data Structures used in Linux kernel
Data Structures used in Linux kernel
 
E nodeb handover procedure
E nodeb handover procedureE nodeb handover procedure
E nodeb handover procedure
 
Initial LTE call Setup Flow
Initial LTE call Setup FlowInitial LTE call Setup Flow
Initial LTE call Setup Flow
 

Recently uploaded

Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 

Recently uploaded (20)

Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 

Architectural Patterns - Interactive and Event Handling Patterns

  • 2. Architectural Patterns Interactive System Patterns – It describes architecture that support the adaptation of user interface parts without causing major effect to Application specific functionality or the underlying data model. • Model-View-Controller
  • 3. Model-View-Controller This pattern can be used to divide system’s task to three different components - Model, View and Controller. • Model contains the core functionality and data. It is independent of the data received or presented in the views. There can be multiple view for same Model. • View displays information to the user. It may allow user to edit the data from the application’s model. • Controller handles user input. It can also perform set-up and coordinating tasks for an application. Views and Controllers together comprise the user interface. A change-propagation mechanism (e.g. Subscriber-obsever) ensures consistency between the user interface and the model.
  • 4. Model-View-Controller Example – Web browser Invoke Result Request HTTP Browser (User) Response Model Servlet (Controller) JSP (View) Database
  • 5. Architectural Patterns Event Handling Patterns – It describes how to initiate, receive, demultiplex, dispatch and process events in networked systems. • Proactor • Reactor • Asynchronous Completion Token • Acceptor-Connector
  • 6. Proactor This pattern can be used for the demultiplexing and dispatching of multiple event handlers which are triggered by the completion of asynchronous events. It requires a dedicated thread for each connected client. In this pattern application issues an asynchronous operation to the OS and registers a callback with a Completion Dispatcher that will notify the Application when the operation completes. The OS then performs the operation on behalf of the application and subsequently queues the result in a well-known location. The Completion Dispatcher is responsible for dequeueing completion notifications and executing the appropriate callback that contains application-specific code.
  • 7. Proactor Client (Web Server) OS Completion Despatcher HTTP Get request Read complete Handler File System Read complete Parse request Read File(sync) Write file data to client connection (Async) Write complete Write complete
  • 8. Proactor Components – Proactive Initiator: Any entity in the application that initiates an Asynchronous Operation. The Proactive Initiator registers a Completion Handler and a Completion Dispatcher with a Asynchronous Operation Processor, which notifies it when the operation completes. Completion Handler (Acceptor ) : interfaces that are implemented by the application for Asynchronous Operation completion notification. Asynchronous Operations : it is used to execute requests (such as I/O and timer operations) on behalf of applications. Asynchronous Operation Processor : When Asynchronous Operations complete, the Asynchronous Operation Processor delegates application notifications to a Completion Dispatcher Completion Dispatcher (the Notification Queue) : it is responsible for calling back to the application’s Completion Handlers when Asynchronous Operations complete.
  • 9. Reactor This can be used for handling service requests delivered concurrently to a service handler by one or more clients by demultiplexes and despathching the incoming requests to the associated request handlers. A reactor defines an interface that allows applications to register or remove event handlers and their associated handles, and run the application's event loop. It uses its synchronous event demultiplexer to wait for indication events to occur on its handle set. When this occurs, the reactor first demultiplexes each indication event from the handle on which it occurs to its associated event handler. Then it dispatches the appropriate hook method on the handler to process the event. Reactor pattern can not support many simultaneous users and/or longduration user requests as it serializes all processing at the event demultiplexing layer. As a result only one request can be dispatched and processed iteratively at any given time.
  • 10. Reactor Components – Resources: Any resource that can provide input to or consume output from the system. Synchronous Event Demultiplexer: Uses an event loop to block on all resources. When it is possible to start a synchronous operation on a resource without blocking, the demultiplexer sends the resource to the dispatcher. Dispatcher: Handles registering and unregistering of request handlers. Dispatches resources from the demultiplexer to the associated request handler. Request Handler: An application defined request handler and its associated resource
  • 11. Reactor Client Reactor Demultiplexer Instantiate event handler register event handler Select(…) handles Dispatch handleEvent(…) Demultiplex handleEvents() EventHandler
  • 12. Asynchronous Completion Token This pattern can be used to demultiplex and process efficiently the responses of asynchronous operations it invokes on services. • For every asynchronous operation that a client invokes on a service, an asynchronous completion token (ACT) is created and Passed to the service together with the operation, which holds but does not modify the ACT. • When the service replies to the initiator, its response includes the ACT that was sent originally. • The initiator can then use the ACT to identify the completion handler that will process the response from the original asynchronous operation
  • 13. Asynchronous Completion Token ACT – It contains information that uniquely identifies the completion handler, which is the function or object responsible for processing the operation's response. Components – Service - Provides functionality that can be accessed asynchronously. Completion handler – It is a function or object within an application that is responsible for processing service responses. Client initiator - Invokes operations on a service asynchronously. It also demultiplexes the response returned by these operations to a designated completion handler.
  • 14. Asynchronous Completion Token Client Initiator Completion Handler ACT Create an ACT Invoke a service including ACT Do some other operation / Process response from other services Response including same ACT Completion_Action Process Result Service
  • 15. Acceptor-Connector This pattern can be used to decouple service tasks performed by a service from the steps required to initialize the service. It is beneficial for an application which receives a large number of concurrent connections with peers residing across long-latency networks and not able to perform blocking or continuous polling for incoming connections on any individual peer due to latency. Components Reactor - The Reactor allows multiple Acceptors to listen for connections from different peers efficiently within a single thread of control. The Reactor allows multiple Service Handlers to have their connections initiated and completed asynchronously by a Connector configured within a single thread of control.
  • 16. Acceptor-Connector Service Handler It contains a communication endpoint (peer stream ) that encapsulates an I/O handle (I/O descriptor). This endpoint is initialized by the Acceptor/Connector and is subsequently used by the Service Handler to exchange data with its connected peer. Acceptor This implements the strategy for passively initializing a Service Handler which communicates with the peer. The Reactor calls back to the Acceptor’s accept method when a connection arrives on the passive-mode peer acceptor endpoint. The accept method uses this passive-mode endpoint to accept connections into the Service Handler’s peer stream and then activate a Service Handler. Connector This implements the strategy for actively initializing a Service Handler which communicates with the peer. The Connector activates a connected Service after initialization is complete. The complete method finishes activating Service Handlers whose connections were initiated and completed asynchronously. the Reactor calls back the complete method automatically when an asynchronous connection is established.
  • 17. Acceptor Acceptor component initialization and service processing : Server Acceptor Initialize end points Service Handler Reactor Register handler Get handle Handle events ( Loop for events) Handle Connection Event Create and Register Service handler Register handler for Client I/O Initialization Complete and ready for service processing Get handle Handle Data Event Service (process msg)
  • 18. Connector Acceptor component initialization and service processing : Server Acceptor Initiate connection Service Handler Reactor Register handler Handle events ( Loop for events) Handle Connection event Connection Complete Perform service-specific initialization Register service handler Initialization Complete and ready for service processing Get handle Handle Data Event Service (process msg)
  • 19. Thank You Your suggestions and comments are always welcome. Please send me your feedback at a_s_sinha@yahoo.com