Also in the Decorator
object you can accept only those objects, which implement that or those interfaces.
Design Patterns
[ 92 ]
Active Record Pattern
This is another very important design pattern to simplify database manipulation. We
will learn more about this pattern in Chapter 7.
Facade Pattern
So far we have learned many common problem-solving approaches using design
patterns in OOP. Here comes another interesting pattern, which we often use
unintentionally in our code without knowing that it is also a pattern. Let us learn
about this common pattern named Facade pattern.
Facade provides a common interface to many objects. In other words, it just
simplifies the programming providing a necessary interface, which actually uses
a lot of other objects behind the scenes. Thus it minimizes the learning curve for
developers. When a new developer joins the team, he suddenly gets introduced to
a lot of objects with tons of methods and properties, among which he might need a
few to accomplish his work. So why bother spending time learning them all? This
is where Facade helps developers and saves a lot of their time. Let's look at some
examples to understand it more clearly.
Pages:
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111