jGuru
Register Email     Password Forgot your
password?
HOME FAQS FORUMS DOWNLOADS ARTICLES PEERSCOPE LEARN

  Search   jGuru Search Help

Q Promoted Facade pattern
Topic: Patterns
s.bala subramaniyam, Mar 25, 2001  [replies:8]
What is the Facade pattern?

Is this item helpful?  yes  no     Previous votes   Yes: 1  No: 0



Answer this question    Manage message; promote etc...  Hide so not publicly visible


Re: facade pattern
Topic: Patterns
Jonas Gustafsson, Mar 30, 2001
Goto: http://rampages.onramp.net/~huston/dp/patterns.html

Is this item helpful?  yes  no     Previous votes   Yes: 0  No: 1



Reply to this answer/comment    Manage message; promote etc...  Hide so not publicly visible
Re: facade pattern
Topic: Patterns
faisal parwani, Apr 10, 2001
facade pattern is used to give the client a urified interface. for example suppose client has to interact with different independent class to perform several task, for this , the client has to know and remember about detail of each and every class , so to avoid this we introduce a facade ( a class) which aggregate all the other classes, and provide the simpler function in it (which internally call the class's orignal method) so in that case the client has to know only about one class . and which is easy for him to remember and use. by providing facade it does not mean that now client will not be able to use other classes, if he want he can. but if he want ease he can use facade .

Is this item helpful?  yes  no     Previous votes   Yes: 0  No: 0



Reply to this answer/comment    Manage message; promote etc...  Hide so not publicly visible
Re: Facade pattern
Topic: Patterns
Wookie Soulmate, Oct 23, 2001
A facade is a simpler mask given to a complex entity. A facade pattern is based on the basic principle that all the complexities are to be hidden behind a simpler interface.

A very appropriate example from JDK itself is the JDBC. JDBC is an abstraction over database-access mechanisms. While a developer is not at all exposed to the nitty-gritties of as to how the databse specific driver classes internally connect to and read data from the database.

All that the developer is exposed is the interfaces like Connection, ResultSet, Statement. Their implementation classes hide all the complexities behind this simple interface we know as JDBC and hence is a facade.

Is this item helpful?  yes  no     Previous votes   Yes: 1  No: 0



Reply to this answer/comment    Manage message; promote etc...  Hide so not publicly visible

Re: Facade pattern
Topic: Patterns
Sriram Gopalan, May 12, 2003  [replies:2]
In short, it is the same age-old concept of Abstraction and Encapsulation.

All well defined objects are facades in a sense. They encapsulate their data and and the actual implementation from the callers and provide services as an abstraction. For example, a Stack object lets the caller push and pop objects without worrying about how it is implemented internally.

The Facade pattern extends the same concept to a higher level. Here, the entire complex inner-workings of a subsystem are encapsulated and a simple abstraction is presented to the outer world as the facade.

The whole JDBC mechanism in Java can be considered a facade. The caller will do something as simple as

PreparedStatement.executeUpdate()
and doesn't worry about the actual complexities of database access, connection pooling etc.

Is this item helpful?  yes  no     Previous votes   Yes: 1  No: 0



Reply to this answer/comment    Manage message; promote etc...  Take off my 'to do' list  Hide so not publicly visible
Re[2]: Facade pattern
Topic: Patterns
Shaun Childers, Aug 30, 2005  [replies:1]
I disagree. JDBC should not be thought of as a facade. The caller making a call using JDBC is very tightly coupled to the JDBC framework due to all of the checked excpetions that must be dealt with.

Hibernate would be good example in terms of a persistence layer as a facade.

Is this item helpful?  yes  no     Previous votes   Yes: 0  No: 0



Reply to this answer/comment    Manage message; promote etc...  Take off my 'to do' list  Hide so not publicly visible
Re[3]: Facade pattern(removing dependencies from a third party jar)
Topic: Patterns
gaurav abbi, Nov 6, 2007
hi all,

i'm using a third party jar to implement some of my functionality.

Now in case there is a whole architectural change in the third party jar, my project also needs to be restructured which is quite a laborious work.

what i want is a kind of design where any future changes in the third party jar(like package restructuring or API changes) i'm using will have a minimal effect on my code. i've read some design patterns but not very sure which will be what combination be helpful.i'm thinking of providing a kind of interface where instead of directly using the third part APIs, i need to make calls through this inerface, but not very sure.

please provide your inputs on implementing this.

i'm adding to this thread because my problem seems to be somewhat similar to this

Is this item helpful?  yes  no     Previous votes   Yes: 0  No: 0



Reply to this answer/comment    Manage message; promote etc...  Take off my 'to do' list  Hide so not publicly visible

Re: Facade pattern
Topic: Patterns
Sheetal Jain, Nov 23, 2008
Facade discusses encapsulating a complex subsystem within a single interface object. This reduces the learning curve necessary to successfully leverage the subsystem. It also promotes decoupling the subsystem from its potentially many clients. On the other hand, if the Facade is the only access point for the subsystem, it will limit the features and flexibility that "power users" may need. The Facade object should be a fairly simple advocate or facilitator. It should not become an all-knowing oracle or "god" object.

Is this item helpful?  yes  no     Previous votes   Yes: 0  No: 0



Reply to this answer/comment    Manage message; promote etc...  Take off my 'to do' list  Hide so not publicly visible
Re: Facade pattern
Topic: Patterns
Subramanian Narayanan, Mar 16, 2009
Facade is unified interace to access multiple classes. The client need not be bothered about multiple classes to accompolish the task. The client just needs to interact with the Facade to get the job done.

For example when the client wants to ship a order in a order management system. Ordering involves calls to multiple classes. This calls can be encapsulated in a facade. The client can then invoke the facade method so that the overall complexity in getting the job done will be reduced. All the complicated logic will reside in the facade. Any future changes in the logic entils to change only in the facade and not in the client.



Is this item helpful?  yes  no     Previous votes   Yes: 0  No: 0



Reply to this answer/comment    Manage message; promote etc...  Take off my 'to do' list  Hide so not publicly visible


Ask A Question



Related Links

Patterns FAQ

Patterns Forum

Design Patterns Home Page

Huston Design Patterns

Brad Appleton's Software Patterns Links

Object-Oriented Bibliography

Wish List
Features
About jGuru
Contact Us

 



The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers