SlideShare una empresa de Scribd logo
1 de 17
Descargar para leer sin conexión
BRIDGE PATTERN
“ decoupling an abstraction from its implementation ”
Jang,Taeksoon
(NHN NEXT)
Wednesday, March 26, 14
MOTIVATION
- Suppose an abstraction should have different implementation
- Simple implementation would just extend the object itself
-Then, inheritance binds an implementation to the abstraction
- When a class changes often, you should change all classes
“ Bridge Pattern helps minimize changes in class ”
Wednesday, March 26, 14
BRIDGE PATTERN DEFINED
- Separate abstraction and implementation
Class itself : Abstraction
What class can do : Implementation
Wednesday, March 26, 14
PARTICIPANT
Abstraction : defines abstract interface and maintains the implementor
reference
Refined Abstraction : extends the interface defined by abstraction
Implementor : defines the interface for implementation classes
Concrete Implementor : implements the Implementor interface
Wednesday, March 26, 14
EXAMPLE & CODE
[ Requirement 1 ]
“ I need a program
that can draw circles and rectangles.“
Wednesday, March 26, 14
EXAMPLE & CODE
[ WhatYou Do ]
Wednesday, March 26, 14
EXAMPLE & CODE
[ Requirement 2 ]
“ I want shapes to be colorful, blue and red! ”
Wednesday, March 26, 14
EXAMPLE & CODE
[ WhatYou Do ]
in progress....
Wednesday, March 26, 14
HERE COMES
BRIDGE PATTERN !!!
Wednesday, March 26, 14
EXAMPLE & CODE
[ WhatYou Do ]
Wednesday, March 26, 14
EXAMPLE & CODE
[ Requirement 3 ]
“ I honestly want Green color andTriangle.“
(oh yes....)
Wednesday, March 26, 14
EXAMPLE & CODE
[ WhatYou Do ]
Wednesday, March 26, 14
EXAMPLE & CODE
Abstraction
Implementation Client
Wednesday, March 26, 14
REAL WORLD EXAMPLE
- GUI Framework
Separate Window abstraction from
Window implementation
for Linux,Windows, or Mac OS.
Wednesday, March 26, 14
REAL WORLD EXAMPLE
ex) Java AWT (Abstract WindowToolkit)
Wednesday, March 26, 14
BENEFIT OF BRIDGE PATTERN
- Avoid binding between abstraction and implementation
=> Able to select implementation at run time
- Reduction in the number of sub classes
- Abstraction and Implementation can be varied independently
- Cleaner code without ‘if’ or ‘switch’ statement
Wednesday, March 26, 14
ADAPTER VS BRIDGE
Adapter
- meant to change the interface of an existing object
- intended to make unrelated classes work together
- My Code + Someone else’s Code
Bridge
- intended to decouple abstraction from its implementation
- Entirely My Code and My Structure
Wednesday, March 26, 14

Más contenido relacionado

La actualidad más candente

Design Patterns - Abstract Factory Pattern
Design Patterns - Abstract Factory PatternDesign Patterns - Abstract Factory Pattern
Design Patterns - Abstract Factory PatternMudasir Qazi
 
Decorator Design Pattern
Decorator Design PatternDecorator Design Pattern
Decorator Design PatternAdeel Riaz
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design patternMindfire Solutions
 
Structural Design pattern - Adapter
Structural Design pattern - AdapterStructural Design pattern - Adapter
Structural Design pattern - AdapterManoj Kumar
 
Observer Software Design Pattern
Observer Software Design Pattern Observer Software Design Pattern
Observer Software Design Pattern Nirthika Rajendran
 
Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan GoleChetan Gole
 
Introduction to design patterns
Introduction to design patternsIntroduction to design patterns
Introduction to design patternsAmit Kabra
 
Abstract Factory Pattern
Abstract Factory PatternAbstract Factory Pattern
Abstract Factory Patternguestcb0002
 
Factory Design Pattern
Factory Design PatternFactory Design Pattern
Factory Design PatternJaswant Singh
 

La actualidad más candente (20)

Design Patterns - Abstract Factory Pattern
Design Patterns - Abstract Factory PatternDesign Patterns - Abstract Factory Pattern
Design Patterns - Abstract Factory Pattern
 
Observer pattern
Observer patternObserver pattern
Observer pattern
 
Decorator Design Pattern
Decorator Design PatternDecorator Design Pattern
Decorator Design Pattern
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design pattern
 
Adapter pattern
Adapter patternAdapter pattern
Adapter pattern
 
Structural Design pattern - Adapter
Structural Design pattern - AdapterStructural Design pattern - Adapter
Structural Design pattern - Adapter
 
Mediator pattern
Mediator patternMediator pattern
Mediator pattern
 
Composite pattern
Composite patternComposite pattern
Composite pattern
 
Observer Software Design Pattern
Observer Software Design Pattern Observer Software Design Pattern
Observer Software Design Pattern
 
Design pattern-presentation
Design pattern-presentationDesign pattern-presentation
Design pattern-presentation
 
Adapter Design Pattern
Adapter Design PatternAdapter Design Pattern
Adapter Design Pattern
 
Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan Gole
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
Builder pattern
Builder patternBuilder pattern
Builder pattern
 
Introduction to java 8 stream api
Introduction to java 8 stream apiIntroduction to java 8 stream api
Introduction to java 8 stream api
 
Introduction to design patterns
Introduction to design patternsIntroduction to design patterns
Introduction to design patterns
 
Abstract Factory Pattern
Abstract Factory PatternAbstract Factory Pattern
Abstract Factory Pattern
 
Factory Design Pattern
Factory Design PatternFactory Design Pattern
Factory Design Pattern
 
Proxy Design Pattern
Proxy Design PatternProxy Design Pattern
Proxy Design Pattern
 
Design Pattern
Design PatternDesign Pattern
Design Pattern
 

Similar a Bridge pattern for Dummies

bridgepattern131062-140326234305-phpapp02.pdf
bridgepattern131062-140326234305-phpapp02.pdfbridgepattern131062-140326234305-phpapp02.pdf
bridgepattern131062-140326234305-phpapp02.pdfssuser97c7e8
 
Design Patterns
Design PatternsDesign Patterns
Design Patternsadil raja
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Javabackdoor
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design PrinciplesAndreas Enbohm
 
Aspect Oriented Programming and MVC with Spring Framework
Aspect Oriented Programming and MVC with Spring FrameworkAspect Oriented Programming and MVC with Spring Framework
Aspect Oriented Programming and MVC with Spring FrameworkMassimiliano Dessì
 
Structural pattern 3
Structural pattern 3Structural pattern 3
Structural pattern 3Naga Muruga
 
CSCI-383 Lecture 3-4: Abstraction
CSCI-383 Lecture 3-4: AbstractionCSCI-383 Lecture 3-4: Abstraction
CSCI-383 Lecture 3-4: AbstractionJI Ruan
 
P Training Presentation
P Training PresentationP Training Presentation
P Training PresentationGaurav Tyagi
 
Slide Presentasi Teknik OO pada Desain Software
Slide Presentasi Teknik OO pada Desain SoftwareSlide Presentasi Teknik OO pada Desain Software
Slide Presentasi Teknik OO pada Desain SoftwareBayu Rimba
 
CSCI 383 Lecture 3 and 4: Abstraction
CSCI 383 Lecture 3 and 4: AbstractionCSCI 383 Lecture 3 and 4: Abstraction
CSCI 383 Lecture 3 and 4: AbstractionJI Ruan
 
Protecting from transient failures in cloud deployments
Protecting from transient failures in cloud deploymentsProtecting from transient failures in cloud deployments
Protecting from transient failures in cloud deploymentswww.pixelsolutionbd.com
 
Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016Schalk Cronjé
 
MATLAB for Researcher Course - ATIT Academy
MATLAB for Researcher  Course - ATIT AcademyMATLAB for Researcher  Course - ATIT Academy
MATLAB for Researcher Course - ATIT AcademyQais Yousef
 

Similar a Bridge pattern for Dummies (20)

bridgepattern131062-140326234305-phpapp02.pdf
bridgepattern131062-140326234305-phpapp02.pdfbridgepattern131062-140326234305-phpapp02.pdf
bridgepattern131062-140326234305-phpapp02.pdf
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Java
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
Aspect Oriented Programming and MVC with Spring Framework
Aspect Oriented Programming and MVC with Spring FrameworkAspect Oriented Programming and MVC with Spring Framework
Aspect Oriented Programming and MVC with Spring Framework
 
Structural pattern 3
Structural pattern 3Structural pattern 3
Structural pattern 3
 
CSCI-383 Lecture 3-4: Abstraction
CSCI-383 Lecture 3-4: AbstractionCSCI-383 Lecture 3-4: Abstraction
CSCI-383 Lecture 3-4: Abstraction
 
P Training Presentation
P Training PresentationP Training Presentation
P Training Presentation
 
Python-DataAbstarction.pptx
Python-DataAbstarction.pptxPython-DataAbstarction.pptx
Python-DataAbstarction.pptx
 
Single Page Applications
Single Page ApplicationsSingle Page Applications
Single Page Applications
 
Slide Presentasi Teknik OO pada Desain Software
Slide Presentasi Teknik OO pada Desain SoftwareSlide Presentasi Teknik OO pada Desain Software
Slide Presentasi Teknik OO pada Desain Software
 
CSCI 383 Lecture 3 and 4: Abstraction
CSCI 383 Lecture 3 and 4: AbstractionCSCI 383 Lecture 3 and 4: Abstraction
CSCI 383 Lecture 3 and 4: Abstraction
 
Bridge Pattern
Bridge PatternBridge Pattern
Bridge Pattern
 
Protecting from transient failures in cloud deployments
Protecting from transient failures in cloud deploymentsProtecting from transient failures in cloud deployments
Protecting from transient failures in cloud deployments
 
Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016
 
Oop
OopOop
Oop
 
Aop2007
Aop2007Aop2007
Aop2007
 
MATLAB for Researcher Course - ATIT Academy
MATLAB for Researcher  Course - ATIT AcademyMATLAB for Researcher  Course - ATIT Academy
MATLAB for Researcher Course - ATIT Academy
 
Bridge Pattern Derek Weeks
Bridge Pattern   Derek WeeksBridge Pattern   Derek Weeks
Bridge Pattern Derek Weeks
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 

Último

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Último (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Bridge pattern for Dummies

  • 1. BRIDGE PATTERN “ decoupling an abstraction from its implementation ” Jang,Taeksoon (NHN NEXT) Wednesday, March 26, 14
  • 2. MOTIVATION - Suppose an abstraction should have different implementation - Simple implementation would just extend the object itself -Then, inheritance binds an implementation to the abstraction - When a class changes often, you should change all classes “ Bridge Pattern helps minimize changes in class ” Wednesday, March 26, 14
  • 3. BRIDGE PATTERN DEFINED - Separate abstraction and implementation Class itself : Abstraction What class can do : Implementation Wednesday, March 26, 14
  • 4. PARTICIPANT Abstraction : defines abstract interface and maintains the implementor reference Refined Abstraction : extends the interface defined by abstraction Implementor : defines the interface for implementation classes Concrete Implementor : implements the Implementor interface Wednesday, March 26, 14
  • 5. EXAMPLE & CODE [ Requirement 1 ] “ I need a program that can draw circles and rectangles.“ Wednesday, March 26, 14
  • 6. EXAMPLE & CODE [ WhatYou Do ] Wednesday, March 26, 14
  • 7. EXAMPLE & CODE [ Requirement 2 ] “ I want shapes to be colorful, blue and red! ” Wednesday, March 26, 14
  • 8. EXAMPLE & CODE [ WhatYou Do ] in progress.... Wednesday, March 26, 14
  • 9. HERE COMES BRIDGE PATTERN !!! Wednesday, March 26, 14
  • 10. EXAMPLE & CODE [ WhatYou Do ] Wednesday, March 26, 14
  • 11. EXAMPLE & CODE [ Requirement 3 ] “ I honestly want Green color andTriangle.“ (oh yes....) Wednesday, March 26, 14
  • 12. EXAMPLE & CODE [ WhatYou Do ] Wednesday, March 26, 14
  • 13. EXAMPLE & CODE Abstraction Implementation Client Wednesday, March 26, 14
  • 14. REAL WORLD EXAMPLE - GUI Framework Separate Window abstraction from Window implementation for Linux,Windows, or Mac OS. Wednesday, March 26, 14
  • 15. REAL WORLD EXAMPLE ex) Java AWT (Abstract WindowToolkit) Wednesday, March 26, 14
  • 16. BENEFIT OF BRIDGE PATTERN - Avoid binding between abstraction and implementation => Able to select implementation at run time - Reduction in the number of sub classes - Abstraction and Implementation can be varied independently - Cleaner code without ‘if’ or ‘switch’ statement Wednesday, March 26, 14
  • 17. ADAPTER VS BRIDGE Adapter - meant to change the interface of an existing object - intended to make unrelated classes work together - My Code + Someone else’s Code Bridge - intended to decouple abstraction from its implementation - Entirely My Code and My Structure Wednesday, March 26, 14