SlideShare une entreprise Scribd logo
1  sur  19
Chain of Responsibility
GoF Behavioral Design Pattern
Scenario: User Authentication
Using email/password

Using Local Network Login/pass

Authentication Module

Using Remote login/pass
Let’s code!
This mass is available at https://gist.github.com/hlegius/e1a721ebbc7de2a91fb1
Code Review
•
•
•
•
•
•
•

We got a Service class;
Skinny Controllers;
Meaningful (and cool) names;
No temp variable;
Short methods;
A lot of non-sense `ifs` statements;
(Very) Complicated logic. (WTF award!)
So, let’s go forward on that ?
WTF dude!?

Wrong design decision indicator!

This mass is available at https://gist.github.com/hlegius/e1a721ebbc7de2a91fb1
Chain of Responsibility
• Decouple client from receivers when you got
more than one object that can handle it;
• Giving you the chance to test each part
(sender and receivers) in isolated.
• Create one point of change if new Receiver
arrives.
• Added flexibility in assigning responsibilities to
objects;
• Boost your code readability like a boss.
This code is available at https://gist.github.com/hlegius/7188168
This code is available at https://gist.github.com/hlegius/7188168
This code is available at https://gist.github.com/hlegius/7188168
Chain of Responsibility
Bad Consequences
• More Lines of Code than first version;
• Complex if you have one or two fixes
receivers;
• Receipt is not guaranteed that will be
handled;
Known Uses
• Handle Events – Also known as “Event
Handler” or “Responder”
• ET++ used Chain of Responsibility to handle
Graphical Updates. (Took from GoF book)
Macro point of view - UML

Client

UserAuthenticator

Handler

Authenticator <abstract>

ConcreteHandler1

EmailAuthenticator

ConcreteHandler2

NetworkAuthenticator

ConcreteHandler3

PartnerAuthenticator
Don't get me wrong!

You can apply this with
PHP, Python, Ruby and so on.
Thank you!

http://programe.me

Reference: GoF book

Contenu connexe

Tendances

Tendances (20)

Being RDBMS Free -- Alternate Approaches to Data Persistence
Being RDBMS Free -- Alternate Approaches to Data PersistenceBeing RDBMS Free -- Alternate Approaches to Data Persistence
Being RDBMS Free -- Alternate Approaches to Data Persistence
 
Production - Designing for Testability
Production - Designing for TestabilityProduction - Designing for Testability
Production - Designing for Testability
 
Thunderstruck by serverless
Thunderstruck  by  serverlessThunderstruck  by  serverless
Thunderstruck by serverless
 
Azure functions
Azure functionsAzure functions
Azure functions
 
CloudFest 2018 Hackathon Project Results Presentation - CFHack18
CloudFest 2018 Hackathon Project Results Presentation - CFHack18CloudFest 2018 Hackathon Project Results Presentation - CFHack18
CloudFest 2018 Hackathon Project Results Presentation - CFHack18
 
When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?
 
Building Autonomous Services
Building Autonomous ServicesBuilding Autonomous Services
Building Autonomous Services
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
 
OSMC 2021 | Contributing to open source with the example of icinga (1)
OSMC 2021 | Contributing to open source with the example of icinga (1)OSMC 2021 | Contributing to open source with the example of icinga (1)
OSMC 2021 | Contributing to open source with the example of icinga (1)
 
We don't need consensus: All agreed?
We don't need consensus: All agreed?We don't need consensus: All agreed?
We don't need consensus: All agreed?
 
Serverless security - how to protect what you don't see?
Serverless security - how to protect what you don't see?Serverless security - how to protect what you don't see?
Serverless security - how to protect what you don't see?
 
The 7 deadly sins of micro services
The 7 deadly sins of micro servicesThe 7 deadly sins of micro services
The 7 deadly sins of micro services
 
Build a Chatbot in Ten Minutes - Dave Kerr - Serverless Summit
Build a Chatbot in Ten Minutes - Dave Kerr - Serverless SummitBuild a Chatbot in Ten Minutes - Dave Kerr - Serverless Summit
Build a Chatbot in Ten Minutes - Dave Kerr - Serverless Summit
 
Applying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codeApplying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance code
 
Microservice Test Strategy (@Bonn Code Meetup)
Microservice Test Strategy (@Bonn Code Meetup)Microservice Test Strategy (@Bonn Code Meetup)
Microservice Test Strategy (@Bonn Code Meetup)
 
Testing Without a GUI Using TestComplete
 Testing Without a GUI Using TestComplete Testing Without a GUI Using TestComplete
Testing Without a GUI Using TestComplete
 
Continuous integration testing 2019 08
Continuous integration testing 2019 08Continuous integration testing 2019 08
Continuous integration testing 2019 08
 
Crafting high quality code
Crafting high quality code Crafting high quality code
Crafting high quality code
 
Forcelandia Salesforce CI
Forcelandia Salesforce CIForcelandia Salesforce CI
Forcelandia Salesforce CI
 
Microservices Testing at Scale
Microservices Testing at ScaleMicroservices Testing at Scale
Microservices Testing at Scale
 

En vedette

En vedette (16)

Bridge Pattern Derek Weeks
Bridge Pattern   Derek WeeksBridge Pattern   Derek Weeks
Bridge Pattern Derek Weeks
 
Bridge pattern
Bridge patternBridge pattern
Bridge pattern
 
Bridge Pattern
Bridge PatternBridge Pattern
Bridge Pattern
 
20120420 - Design pattern bridge
20120420 - Design pattern bridge20120420 - Design pattern bridge
20120420 - Design pattern bridge
 
Bridge Design Pattern
Bridge Design PatternBridge Design Pattern
Bridge Design Pattern
 
Chain of responsibility
Chain of responsibilityChain of responsibility
Chain of responsibility
 
Command Pattern
Command PatternCommand Pattern
Command Pattern
 
Command pattern
Command patternCommand pattern
Command pattern
 
Chain of Responsibility Pattern
Chain of Responsibility PatternChain of Responsibility Pattern
Chain of Responsibility Pattern
 
Adapter Design Pattern
Adapter Design PatternAdapter Design Pattern
Adapter Design Pattern
 
Bridge Design Pattern
Bridge Design PatternBridge Design Pattern
Bridge Design Pattern
 
Command Design Pattern
Command Design PatternCommand Design Pattern
Command Design Pattern
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statistics
 
Adapter Design Pattern
Adapter Design PatternAdapter Design Pattern
Adapter Design Pattern
 
Implementing the Adapter Design Pattern
Implementing the Adapter Design PatternImplementing the Adapter Design Pattern
Implementing the Adapter Design Pattern
 
Security and Integrity of Data
Security and Integrity of DataSecurity and Integrity of Data
Security and Integrity of Data
 

Similaire à Chain of Responsibility Pattern

Kubernetes and container security
Kubernetes and container securityKubernetes and container security
Kubernetes and container security
Volodymyr Shynkar
 

Similaire à Chain of Responsibility Pattern (20)

Secure Your Open Source Projects For Free
Secure Your Open Source Projects For FreeSecure Your Open Source Projects For Free
Secure Your Open Source Projects For Free
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
Introduction to Blockchain and Hyperledger
Introduction to Blockchain and HyperledgerIntroduction to Blockchain and Hyperledger
Introduction to Blockchain and Hyperledger
 
Securing API data models
Securing API data modelsSecuring API data models
Securing API data models
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
Kubernetes and container security
Kubernetes and container securityKubernetes and container security
Kubernetes and container security
 
How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
Kerberos, Token and Hadoop
Kerberos, Token and HadoopKerberos, Token and Hadoop
Kerberos, Token and Hadoop
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
SHIFT LEFT WITH DEVSECOPS
SHIFT LEFT WITH DEVSECOPSSHIFT LEFT WITH DEVSECOPS
SHIFT LEFT WITH DEVSECOPS
 
Just kill it
Just kill itJust kill it
Just kill it
 
Protect Your Payloads: Modern Keying Techniques
Protect Your Payloads: Modern Keying TechniquesProtect Your Payloads: Modern Keying Techniques
Protect Your Payloads: Modern Keying Techniques
 
Blockchain in the Food Supply Chain (v2)
Blockchain in the Food Supply Chain (v2)Blockchain in the Food Supply Chain (v2)
Blockchain in the Food Supply Chain (v2)
 
Application Lifecycle Management
Application Lifecycle ManagementApplication Lifecycle Management
Application Lifecycle Management
 

Plus de Hélio Costa e Silva (6)

Annotation Sniffer Hotspots implementation
Annotation Sniffer Hotspots implementationAnnotation Sniffer Hotspots implementation
Annotation Sniffer Hotspots implementation
 
Lightning talk - Framework Architecture: Hotspots
Lightning talk  -  Framework Architecture: HotspotsLightning talk  -  Framework Architecture: Hotspots
Lightning talk - Framework Architecture: Hotspots
 
Vex 2009-2011
Vex 2009-2011Vex 2009-2011
Vex 2009-2011
 
Definir classe não é programar com orientação a objetos
Definir classe não é programar com orientação a objetosDefinir classe não é programar com orientação a objetos
Definir classe não é programar com orientação a objetos
 
WebVibe Barueri 2011 - "PHP por quê ?"
WebVibe Barueri 2011 - "PHP por quê ?"WebVibe Barueri 2011 - "PHP por quê ?"
WebVibe Barueri 2011 - "PHP por quê ?"
 
Test-Driven Development - Introdução
Test-Driven Development - IntroduçãoTest-Driven Development - Introdução
Test-Driven Development - Introdução
 

Dernier

9990771857 Call Girls in Dwarka Sector 137 Noida (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 137 Noida (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 137 Noida (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 137 Noida (Call Girls) Delhi
delhimodel235
 
9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi
delhimodel235
 
Call Girls In Seelampur Delhi ↬8447779280}Seelampur Escorts Service In Delhi...
Call Girls In Seelampur  Delhi ↬8447779280}Seelampur Escorts Service In Delhi...Call Girls In Seelampur  Delhi ↬8447779280}Seelampur Escorts Service In Delhi...
Call Girls In Seelampur Delhi ↬8447779280}Seelampur Escorts Service In Delhi...
asmaqueen5
 
9990771857 Call Girls in Dwarka Sector 08 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 08 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 08 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 08 Delhi (Call Girls) Delhi
delhimodel235
 
9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi
delhimodel235
 
Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...
Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...
Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...
asmaqueen5
 
9990771857 Call Girls in Dwarka Sector 3 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 3 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 3 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 3 Delhi (Call Girls) Delhi
delhimodel235
 
Call Girls in Karkardooma Delhi +91 84487779280}Woman Seeking Man in Delhi NCR
Call Girls in Karkardooma Delhi +91 84487779280}Woman Seeking Man in Delhi NCRCall Girls in Karkardooma Delhi +91 84487779280}Woman Seeking Man in Delhi NCR
Call Girls in Karkardooma Delhi +91 84487779280}Woman Seeking Man in Delhi NCR
asmaqueen5
 
BPTP THE AMAARIO Luxury Project Invest Like Royalty in Sector 37D Gurgaon Dwa...
BPTP THE AMAARIO Luxury Project Invest Like Royalty in Sector 37D Gurgaon Dwa...BPTP THE AMAARIO Luxury Project Invest Like Royalty in Sector 37D Gurgaon Dwa...
BPTP THE AMAARIO Luxury Project Invest Like Royalty in Sector 37D Gurgaon Dwa...
ApartmentWala1
 
9990771857 Call Girls Dwarka Sector 9 Delhi (Call Girls ) Delhi
9990771857 Call Girls Dwarka Sector 9 Delhi (Call Girls ) Delhi9990771857 Call Girls Dwarka Sector 9 Delhi (Call Girls ) Delhi
9990771857 Call Girls Dwarka Sector 9 Delhi (Call Girls ) Delhi
delhimodel235
 

Dernier (20)

9990771857 Call Girls in Dwarka Sector 137 Noida (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 137 Noida (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 137 Noida (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 137 Noida (Call Girls) Delhi
 
Greater Vancouver Realtors Statistics Package April 2024
Greater Vancouver Realtors Statistics Package April 2024Greater Vancouver Realtors Statistics Package April 2024
Greater Vancouver Realtors Statistics Package April 2024
 
M3M 129 E Brochure Noida Expressway, Sector 129, Noida
M3M 129 E Brochure Noida Expressway, Sector 129, NoidaM3M 129 E Brochure Noida Expressway, Sector 129, Noida
M3M 129 E Brochure Noida Expressway, Sector 129, Noida
 
9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 6 Delhi (Call Girls) Delhi
 
Call Girls In Seelampur Delhi ↬8447779280}Seelampur Escorts Service In Delhi...
Call Girls In Seelampur  Delhi ↬8447779280}Seelampur Escorts Service In Delhi...Call Girls In Seelampur  Delhi ↬8447779280}Seelampur Escorts Service In Delhi...
Call Girls In Seelampur Delhi ↬8447779280}Seelampur Escorts Service In Delhi...
 
9990771857 Call Girls in Dwarka Sector 08 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 08 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 08 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 08 Delhi (Call Girls) Delhi
 
2k Shot Call girls Aiims Delhi 9205541914
2k Shot Call girls Aiims Delhi 92055419142k Shot Call girls Aiims Delhi 9205541914
2k Shot Call girls Aiims Delhi 9205541914
 
9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 1 Delhi (Call Girls) Delhi
 
Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...
Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...
Call Girls In Krishna Nagar Delhi (Escort)↫8447779280↬@SHOT 1500- NIGHT 5500→...
 
9990771857 Call Girls in Dwarka Sector 3 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 3 Delhi (Call Girls) Delhi9990771857 Call Girls in Dwarka Sector 3 Delhi (Call Girls) Delhi
9990771857 Call Girls in Dwarka Sector 3 Delhi (Call Girls) Delhi
 
Mahindra Happinest Tathawade Pune Brochure.pdf
Mahindra Happinest Tathawade Pune Brochure.pdfMahindra Happinest Tathawade Pune Brochure.pdf
Mahindra Happinest Tathawade Pune Brochure.pdf
 
Kohinoor Flats In Hinjewadi Phase 2 | Homes Built To Suit Your Needs
Kohinoor Flats In Hinjewadi Phase 2 | Homes Built To Suit Your NeedsKohinoor Flats In Hinjewadi Phase 2 | Homes Built To Suit Your Needs
Kohinoor Flats In Hinjewadi Phase 2 | Homes Built To Suit Your Needs
 
Call Girls in Karkardooma Delhi +91 84487779280}Woman Seeking Man in Delhi NCR
Call Girls in Karkardooma Delhi +91 84487779280}Woman Seeking Man in Delhi NCRCall Girls in Karkardooma Delhi +91 84487779280}Woman Seeking Man in Delhi NCR
Call Girls in Karkardooma Delhi +91 84487779280}Woman Seeking Man in Delhi NCR
 
BPTP THE AMAARIO Luxury Project Invest Like Royalty in Sector 37D Gurgaon Dwa...
BPTP THE AMAARIO Luxury Project Invest Like Royalty in Sector 37D Gurgaon Dwa...BPTP THE AMAARIO Luxury Project Invest Like Royalty in Sector 37D Gurgaon Dwa...
BPTP THE AMAARIO Luxury Project Invest Like Royalty in Sector 37D Gurgaon Dwa...
 
9990771857 Call Girls Dwarka Sector 9 Delhi (Call Girls ) Delhi
9990771857 Call Girls Dwarka Sector 9 Delhi (Call Girls ) Delhi9990771857 Call Girls Dwarka Sector 9 Delhi (Call Girls ) Delhi
9990771857 Call Girls Dwarka Sector 9 Delhi (Call Girls ) Delhi
 
2k Shots ≽ 9205541914 ≼ Call Girls In Sainik Farm (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Sainik Farm (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Sainik Farm (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Sainik Farm (Delhi)
 
Kohinoor Hinjewadi Phase 2 Pune E-Brochure.pdf
Kohinoor Hinjewadi Phase 2 Pune  E-Brochure.pdfKohinoor Hinjewadi Phase 2 Pune  E-Brochure.pdf
Kohinoor Hinjewadi Phase 2 Pune E-Brochure.pdf
 
SVN Live 5.6.24 Weekly Property Broadcast
SVN Live 5.6.24 Weekly Property BroadcastSVN Live 5.6.24 Weekly Property Broadcast
SVN Live 5.6.24 Weekly Property Broadcast
 
Purva Soukhyam in Guduvancheri Chennai.pdf
Purva Soukhyam in Guduvancheri Chennai.pdfPurva Soukhyam in Guduvancheri Chennai.pdf
Purva Soukhyam in Guduvancheri Chennai.pdf
 
Kolte Patil Kharadi Pune E Brochure.pdf
Kolte Patil Kharadi Pune E  Brochure.pdfKolte Patil Kharadi Pune E  Brochure.pdf
Kolte Patil Kharadi Pune E Brochure.pdf
 

Chain of Responsibility Pattern

  • 1. Chain of Responsibility GoF Behavioral Design Pattern
  • 2. Scenario: User Authentication Using email/password Using Local Network Login/pass Authentication Module Using Remote login/pass
  • 4.
  • 5. This mass is available at https://gist.github.com/hlegius/e1a721ebbc7de2a91fb1
  • 6. Code Review • • • • • • • We got a Service class; Skinny Controllers; Meaningful (and cool) names; No temp variable; Short methods; A lot of non-sense `ifs` statements; (Very) Complicated logic. (WTF award!)
  • 7. So, let’s go forward on that ?
  • 8.
  • 9. WTF dude!? Wrong design decision indicator! This mass is available at https://gist.github.com/hlegius/e1a721ebbc7de2a91fb1
  • 10. Chain of Responsibility • Decouple client from receivers when you got more than one object that can handle it; • Giving you the chance to test each part (sender and receivers) in isolated. • Create one point of change if new Receiver arrives. • Added flexibility in assigning responsibilities to objects; • Boost your code readability like a boss.
  • 11. This code is available at https://gist.github.com/hlegius/7188168
  • 12.
  • 13. This code is available at https://gist.github.com/hlegius/7188168
  • 14. This code is available at https://gist.github.com/hlegius/7188168
  • 15. Chain of Responsibility Bad Consequences • More Lines of Code than first version; • Complex if you have one or two fixes receivers; • Receipt is not guaranteed that will be handled;
  • 16. Known Uses • Handle Events – Also known as “Event Handler” or “Responder” • ET++ used Chain of Responsibility to handle Graphical Updates. (Took from GoF book)
  • 17. Macro point of view - UML Client UserAuthenticator Handler Authenticator <abstract> ConcreteHandler1 EmailAuthenticator ConcreteHandler2 NetworkAuthenticator ConcreteHandler3 PartnerAuthenticator
  • 18. Don't get me wrong! You can apply this with PHP, Python, Ruby and so on.