Summary on basis of the book ,,Design Patterns: Elements of Reusable Object-Oriented Software'', by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides, Addison-Wesley, 1995.
We use it to separate abstraction from its implementation. Actually we usually have a class hierarchy for imlementation (e.g. arrayList, static array), and separate class hierarchy for abstraction (FIFO, LIFO) - in this way we connect them.
Class{Bridge pattern is when we use Interface/Absract class in a class instead of concrete subclasses, and instantiate it from outside, with concrete instance.
House house;
...
}
...
public static void main(String[] args){
Class c = new Class(new DetachedHouse());
}
We use it to separate abstraction from its implementation. Actually we usually have a class hierarchy for imlementation (e.g. arrayList, static array), and separate class hierarchy for abstraction (FIFO, LIFO) - in this way we connect them.
Comments
Want to leave a comment? Visit this post's issue page
on GitHub and just post your comment as the issue's comment (you'll need a GitHub account. What? Like you don't have one yet?!).
Comments: