computer science 490.002 topical paper presentation #07

6
Computer Science 490.002 Topical Paper Presentation #07 John Jenkins The Emissary Design Pattern Pattern Emissary Design Pattern – Page 1 “The Emissary Design Pattern” by Ramiro González Maciel LIFIA – La Plata National University, Argentina

Upload: essien

Post on 16-Feb-2016

49 views

Category:

Documents


0 download

DESCRIPTION

Computer Science 490.002 Topical Paper Presentation #07. Pattern Emissary Design Pattern – Page 1. John Jenkins. The Emissary Design Pattern. “The Emissary Design Pattern” by Ramiro Gonz ález Maciel LIFIA – La Plata National University, Argentina. The Problem. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Computer Science 490.002 Topical Paper Presentation #07

Computer Science 490.002Topical Paper Presentation #07John JenkinsThe Emissary Design Pattern

Pattern Emissary Design Pattern –

Page 1

“The Emissary Design Pattern”by

Ramiro González MacielLIFIA – La Plata National

University, Argentina

Page 2: Computer Science 490.002 Topical Paper Presentation #07

The ProblemOne of the major issues with Distributed Systems is code synchronicity. When the client application has certain error codes, the server must be updated accordingly.

This is a real problem in any Distributed System environment.

Pattern Emissary Design Pattern –

Page 2

There must be duplicate error code in both the client and server code.Communication from the server back to the client can be complicated.Multiple solutions are nearly impossible with a massive amount of code and client communication with the server on how to handle an error makes the solution get very complex very quickly.

Page 3: Computer Science 490.002 Topical Paper Presentation #07

The Emissary Design PatternThe client makes calls to the server with an additional parameter, an Emissary object.

The ConcreteEmissary objects are the different types of ways that a Server may handle an error.

Pattern Emissary Design Pattern –

Page 3

The Server handles calls to it as normal, but, when an error arises, it calls the appropriate handle event within the parameterized Emissary object. All Helper objects may use this Emissary object as well.

Page 4: Computer Science 490.002 Topical Paper Presentation #07

Real-World ApplicationThe client is the BigBangOriginCalculator, and it will make calls to the HubbleTelescope, SuperComputerArray, and TriangulationEquipment with at least one parameter of an Emissary object. Each Emissary object describes a different method for handling an error.

Rather than having duplicate code for handling and signaling errors on both the client and server sides, one Emissary object can handle a specific method for handling an error, which is created by the client and passed to the server.

Pattern Emissary Design Pattern –

Page 4

LoggingEmissary RetryEmissary InteractiveEmissary

BigBangOriginCalculator

BeginLooking()

HubbleTelescope

PositionSatalite()TakePicture()GathersImages

SuperComputerArray

CalculateNewPosition()

UsesForCalculations

TriangulationEquipment

CalculateBodyPosition()

RequestsLocations

Emissary

Request

Page 5: Computer Science 490.002 Topical Paper Presentation #07
Page 6: Computer Science 490.002 Topical Paper Presentation #07

Pattern AnalysisThis pattern is extremely useful for code that is already very complex by preventing or removing error handling code.

Not only is this pattern applicable in the Distributed Systems world, I would be surprised if it wasn’t used rather regularly.

Pattern Emissary Design Pattern –

Page 6

It is allows for a much simpler method of communicating with the client rather than having predefined solutions to errors.Easier implementation of multiple error handling techniques.Overall, his presentation of the material was very well organized, and I feel that this is a very useful pattern.