Archive

Posts Tagged ‘facade’

THE FAÇADE PATTERN

July 6th, 2009 Touna 2 comments

Frequently, as your programs evolve and develop, they grow in
complexity. In fact, for all the excitement about using design patterns, these
patterns sometimes generate so many classes that it is difficult to understand
the program’s flow. Furthermore, there may be a number of complicated
subsystems, each of which has its own complex interface.
The Façade pattern allows you to simplify this complexity by
providing a simplified interface to these subsystems. This simplification may
in some cases reduce the flexibility of the underlying classes, but usually
provides all the function needed for all but the most sophisticated users.
These users can still, of course, access the underlying classes and methods.
Fortunately, we don’t have to write a complex system to provide an
example of where a Facade can be useful. Java provides a set of classes that
connect to databases using an interface called JDBC. You can connect to any
database for which the manufacturer has provided a JDBC connection class —
almost every database on he market. Some databases have direct connections
using JDBC and a few allow connection to ODBC driver using the JDBCODBC
bridge class.

Read more…

Design Patterns

June 12th, 2009 Touna 2 comments

I recently read something to the effect that mastering the use of a set of patterns is the ultimate goal of someone intending to seriously study design patterns. That said, here we go…

There are 3 examples in this tutorial. They are progressively more complex. Here’s the first one, Singleton, rather simple.

Example 1 : Singleton

Rationalle and Motivation

The singleton pattern applies to the many situations in which there needs to be a single instance of a class, a single object. It is often left up to the programmer to insure that the An important consideration in implementing this pattern is how to make this single instance easily accessible by many other objects.

Read more…

Powered by WP Robot