0% found this document useful (0 votes)
38 views

Design Pattern Software Engineering: Abstraction Implementation

The bridge pattern is a software design pattern that decouples an abstraction from its implementation, allowing them to vary independently. It uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. The bridge pattern is useful when a class and what it does need to vary often. It can be thought of as two layers of abstraction, with the class being the implementation and what the class can do being the abstraction. The bridge pattern is often confused with and implemented using the adapter pattern.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Design Pattern Software Engineering: Abstraction Implementation

The bridge pattern is a software design pattern that decouples an abstraction from its implementation, allowing them to vary independently. It uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. The bridge pattern is useful when a class and what it does need to vary often. It can be thought of as two layers of abstraction, with the class being the implementation and what the class can do being the abstraction. The bridge pattern is often confused with and implemented using the adapter pattern.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

The 

bridge pattern is adesign


pattern used insoftware
engineering which is meant
to "decouple anabstraction from
itsimplementation so that the two
can vary independently"[1].
The bridge usesencapsulation, aggr
egation, and can use inheritance to
separate responsibilities into
different classes.
When a class varies often, the
features of object-oriented
programming become very useful
because changes to
a program's code can be made
easily with minimal prior knowledge
about the program. The bridge
pattern is useful when both the
class as well as what it does vary
often. The class itself can be
thought of as
the implementation and what the
class can do as the abstraction. The
bridge pattern can also be thought
of as two layers of abstraction.
The bridge pattern is often
confused with the adapter pattern.
In fact, the bridge pattern is often
implemented using the class
adapter pattern, e.g. in the C++
code below.
Variant: The implementation can be
decoupled even more by deferring
the presence of the implementation
to the point where the abstraction is
utilized.
Abstraction
defines the abstract interface
maintains the Implementor
reference
RefinedAbstraction
extends the interface defined by
Abstraction
Implementor
defines the interface for
implementation classes
ConcreteImplementor
implements the Implementor
interface
[e

You might also like