SlideShare a Scribd company logo
2
Most read
3
Most read
7
Most read
bridge-design-pattern.pptx
Bridge Design Pattern
Pattern Name:
• Bridge Design Pattern
Intent:
• Decouple an abstraction from its implementation so that the two can vary independently.
Example
• For example, let’s say you are creating various GUI shapes with
different colors. One solution could be:
Without Bridge pattern
• But above solution has a problem. If you want to change Rectangle
class, then you may end up chaging BlueRectangle and RedRectangle
as well. And even if change is color specific then you may need to
change circle classes as well.
You can solve above problem by decoupling the Shape and
Color interfaces in below manner:
With Bridge Pattern
Now when you change any Shape, color would be unchanged. Similarily, vice-
versa.
Problem
• "Hardening of the software arteries" has occurred by using
subclassing of an abstract base class to provide alternative
implementations. This locks in compile-time binding between
interface and implementation. The abstraction and implementation
cannot be independently extended or composed.
• Bridge design pattern is most applicable in applications where you
need to provide platform independence.
Structure
Advantages
• Bridge pattern decouple an abstraction from its implementation so
that the two can vary independently.
• Reduction in the number of sub classes – Sometimes, using pure
inheritance will increase the number of sub-classes.
• Cleaner code and Reduction in executable size
Disadvantages
• Increases complexity.
• Double indirection – This will have a slight impact on performance.
The abstraction needs to pass messages along to the implementator
for the operation to get executed.

More Related Content

PPTX
Software Process Models
PPTX
PPTX
Getting Started with MySQL I
PPT
Database systems introduction
PDF
MySQL Workbench Tutorial | Introduction To MySQL Workbench | MySQL DBA Traini...
PPTX
User, roles and privileges
PDF
Sql a practical introduction
Software Process Models
Getting Started with MySQL I
Database systems introduction
MySQL Workbench Tutorial | Introduction To MySQL Workbench | MySQL DBA Traini...
User, roles and privileges
Sql a practical introduction

What's hot (20)

PPTX
PPT
Data models
PPTX
Ventajas y desventajas mysql
PPT
MySQL and its basic commands
PPT
LiquiBase
PPTX
Database Management System (DBMS) | Computer Science
PPTX
Non relational databases-no sql
PPTX
My Sql Work Bench
PDF
Database backup and recovery
PPT
4 internet programming
PPT
Normalization
PDF
Enhanced Entity-Relationship (EER) Modeling
PPT
MySQL ppt
PPTX
DATABASE CONSTRAINTS
PPTX
java Jdbc
PPT
Fundamentals of Database system
PPTX
Database Languages.pptx
PPTX
Data partitioning
PPTX
Basic Concept Of Database Management System (DBMS) [Presentation Slide]
Data models
Ventajas y desventajas mysql
MySQL and its basic commands
LiquiBase
Database Management System (DBMS) | Computer Science
Non relational databases-no sql
My Sql Work Bench
Database backup and recovery
4 internet programming
Normalization
Enhanced Entity-Relationship (EER) Modeling
MySQL ppt
DATABASE CONSTRAINTS
java Jdbc
Fundamentals of Database system
Database Languages.pptx
Data partitioning
Basic Concept Of Database Management System (DBMS) [Presentation Slide]
Ad

Similar to bridge-design-pattern.pptx (20)

PPS
Bridge Pattern Derek Weeks
PDF
Bridge pattern for Dummies
PDF
bridgepattern131062-140326234305-phpapp02.pdf
PPTX
Bridge Design Pattern
PPTX
Bridge Pattern
PPT
Bridge Design Pattern
PPTX
Structural pattern 3
PPTX
Software Patterns
PPTX
UNIT IV DESIGN PATTERNS.pptx
PPTX
Dependency Injection, Design Principles and Patterns
ODP
Design Patterns Part1
PPTX
How to design an application correctly ?
PPTX
Design pattern and their application
PPTX
GoF Design patterns I: Introduction + Structural Patterns
PPT
Adapter Design Pattern
PPTX
Design patterns
PPTX
ap assignmnet presentation.pptx
PDF
Software and architecture design pattern
PPTX
Design Patterns
PPTX
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
Bridge Pattern Derek Weeks
Bridge pattern for Dummies
bridgepattern131062-140326234305-phpapp02.pdf
Bridge Design Pattern
Bridge Pattern
Bridge Design Pattern
Structural pattern 3
Software Patterns
UNIT IV DESIGN PATTERNS.pptx
Dependency Injection, Design Principles and Patterns
Design Patterns Part1
How to design an application correctly ?
Design pattern and their application
GoF Design patterns I: Introduction + Structural Patterns
Adapter Design Pattern
Design patterns
ap assignmnet presentation.pptx
Software and architecture design pattern
Design Patterns
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
Ad

Recently uploaded (20)

PPTX
modul_python (1).pptx for professional and student
PDF
Votre score augmente si vous choisissez une catégorie et que vous rédigez une...
PPTX
IMPACT OF LANDSLIDE.....................
PDF
Introduction to Data Science and Data Analysis
PDF
Business Analytics and business intelligence.pdf
PDF
OneRead_20250728_1808.pdfhdhddhshahwhwwjjaaja
PPTX
(Ali Hamza) Roll No: (F24-BSCS-1103).pptx
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PDF
Transcultural that can help you someday.
PPTX
Introduction to Inferential Statistics.pptx
PDF
Data Engineering Interview Questions & Answers Batch Processing (Spark, Hadoo...
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPT
ISS -ESG Data flows What is ESG and HowHow
PDF
Microsoft Core Cloud Services powerpoint
PPTX
Pilar Kemerdekaan dan Identi Bangsa.pptx
PPTX
Market Analysis -202507- Wind-Solar+Hybrid+Street+Lights+for+the+North+Amer...
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
PDF
Systems Analysis and Design, 12th Edition by Scott Tilley Test Bank.pdf
PDF
Data Engineering Interview Questions & Answers Cloud Data Stacks (AWS, Azure,...
PDF
Optimise Shopper Experiences with a Strong Data Estate.pdf
modul_python (1).pptx for professional and student
Votre score augmente si vous choisissez une catégorie et que vous rédigez une...
IMPACT OF LANDSLIDE.....................
Introduction to Data Science and Data Analysis
Business Analytics and business intelligence.pdf
OneRead_20250728_1808.pdfhdhddhshahwhwwjjaaja
(Ali Hamza) Roll No: (F24-BSCS-1103).pptx
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
Transcultural that can help you someday.
Introduction to Inferential Statistics.pptx
Data Engineering Interview Questions & Answers Batch Processing (Spark, Hadoo...
Acceptance and paychological effects of mandatory extra coach I classes.pptx
ISS -ESG Data flows What is ESG and HowHow
Microsoft Core Cloud Services powerpoint
Pilar Kemerdekaan dan Identi Bangsa.pptx
Market Analysis -202507- Wind-Solar+Hybrid+Street+Lights+for+the+North+Amer...
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
Systems Analysis and Design, 12th Edition by Scott Tilley Test Bank.pdf
Data Engineering Interview Questions & Answers Cloud Data Stacks (AWS, Azure,...
Optimise Shopper Experiences with a Strong Data Estate.pdf

bridge-design-pattern.pptx

  • 2. Bridge Design Pattern Pattern Name: • Bridge Design Pattern Intent: • Decouple an abstraction from its implementation so that the two can vary independently.
  • 3. Example • For example, let’s say you are creating various GUI shapes with different colors. One solution could be: Without Bridge pattern • But above solution has a problem. If you want to change Rectangle class, then you may end up chaging BlueRectangle and RedRectangle as well. And even if change is color specific then you may need to change circle classes as well.
  • 4. You can solve above problem by decoupling the Shape and Color interfaces in below manner: With Bridge Pattern Now when you change any Shape, color would be unchanged. Similarily, vice- versa.
  • 5. Problem • "Hardening of the software arteries" has occurred by using subclassing of an abstract base class to provide alternative implementations. This locks in compile-time binding between interface and implementation. The abstraction and implementation cannot be independently extended or composed. • Bridge design pattern is most applicable in applications where you need to provide platform independence.
  • 7. Advantages • Bridge pattern decouple an abstraction from its implementation so that the two can vary independently. • Reduction in the number of sub classes – Sometimes, using pure inheritance will increase the number of sub-classes. • Cleaner code and Reduction in executable size
  • 8. Disadvantages • Increases complexity. • Double indirection – This will have a slight impact on performance. The abstraction needs to pass messages along to the implementator for the operation to get executed.