473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Facade pattern

I'm a little confused about the Facade pattern. As I understand
it, it's supposed to be a single, simplified interface into a larger
amount of subsystems. The question I have is basically how simple and
interface is it supposed to be? Lets say I've got an application with
multiple layers in differenct projects. I've got a Core project that
contains the core business objects and Managers for those objects.
Managers are responsible for locating, saving, and deleting objects of
a certain type (eg. XXManager manages XX objects). Each Manager
implements a IXXManager interface that defines these functions (Thanks
to the newsgroup for helping me decide on that arch.). Does it make
sense to have a CoreModelFacade that encapulates all the functionality
of the individual Managers and have my forms (the view) communicate
solely with the Facade? This would lead to having a very large class
that would basically implement all of the IXXManager's interfaces and
just pass the requests on down the line to the individual managers.
What I don't like about this is that it's not very extensible.
Every time I add a new Core object, I have to modify this Facade to add
the new functionality. Basically this Facade would end up being a
single class that represents the whole API. Am I interperating this
correctly? One thing I do like about this is it creates a nice
seperation between the Model and everything else. Each View (form,
control, etc) would hook up to the Model through the Facade and apply
its filter to the data, listen for events from the Model of when data
changes, see if the changes effect the data it's displaying. But
following an arch. like that leads me to ask where the filter would be,
in the View or in the Model. Would the Model have a function
Employee_List getSalesEmployees(), or would the Model just have an
Employee_List getEmployees() function and the View would filter out all
non Sales Employees? In the second case, it would seem like alot of
extra data is going to be passed around, while in the first case alot
more functions will be in the interface.
Are there any good books out there describing different (non
enterprise/distributed) application architectures?

Mar 3 '06 #1
1 3973
Hello anonymous,

The key idea of facade to give unified interfaces for subsitems bases on
some subject logic
In your case, for example, there could be CoreModelADMINFacade and CoreModelUSERFacade.
First incapsulates interfaces from componets that is used only by admin -
this give u isolation and secure way to protect your components from guest
users. Other incapsulates interfaces for all users

See facade sample over there http://www.dofactory.com/Patterns/PatternFacade.aspx

au> I'm a little confused about the Facade pattern. As I
au> understand
au> it, it's supposed to be a single, simplified interface into a larger
au> amount of subsystems. The question I have is basically how simple
au> and
au> interface is it supposed to be? Lets say I've got an application
au> with
au> multiple layers in differenct projects. I've got a Core project
au> that
au> contains the core business objects and Managers for those objects.
au> Managers are responsible for locating, saving, and deleting objects
au> of
au> a certain type (eg. XXManager manages XX objects). Each Manager
au> implements a IXXManager interface that defines these functions
au> (Thanks
au> to the newsgroup for helping me decide on that arch.). Does it make
au> sense to have a CoreModelFacade that encapulates all the
au> functionality
au> of the individual Managers and have my forms (the view) communicate
au> solely with the Facade? This would lead to having a very large
au> class
au> that would basically implement all of the IXXManager's interfaces
au> and
au> just pass the requests on down the line to the individual managers.
au> What I don't like about this is that it's not very extensible.
au> Every time I add a new Core object, I have to modify this Facade to
au> add
au> the new functionality. Basically this Facade would end up being a
au> single class that represents the whole API. Am I interperating this
au> correctly? One thing I do like about this is it creates a nice
au> seperation between the Model and everything else. Each View (form,
au> control, etc) would hook up to the Model through the Facade and
au> apply
au> its filter to the data, listen for events from the Model of when
au> data
au> changes, see if the changes effect the data it's displaying. But
au> following an arch. like that leads me to ask where the filter would
au> be,
au> in the View or in the Model. Would the Model have a function
au> Employee_List getSalesEmployees(), or would the Model just have an
au> Employee_List getEmployees() function and the View would filter out
au> all
au> non Sales Employees? In the second case, it would seem like alot of
au> extra data is going to be passed around, while in the first case
au> alot
au> more functions will be in the interface.
au> Are there any good books out there describing different (non
au> enterprise/distributed) application architectures?
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bdinmstig | last post by:
I am building various framework components for my team to use in development, and one of those components is a Facade for reading/writing user preferences. The idea is that preference settings...
1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
1
by: Daniel Kabs | last post by:
Hello, loading images or refreshing IFRAME content is done asynchronously in Javascript. You just assign a value to the src attribute of the object and you are done. Once loading is finished,...
11
by: FluffyCat | last post by:
In Febraury - April of 2002 I put together in Java examples of all 23 of the classic "Gang Of Four" design patterns for my website. Partly I wanted to get a better understanding of those patterns....
0
by: Dave Johnson | last post by:
I had a problem in my OO Design, the idea is that i have a DataRepository Class That i want to only inherit from it speacial methods accourding to the child class, like i want the Client Class to...
1
by: Dave Johnson | last post by:
I had a problem in my OO Design, the idea is that i have a DataRepository Class That i want to only inherit from it speacial methods accourding to the child class, like i want the Client Class to...
1
by: Dave Johnson | last post by:
I had a problem in my OO Design, the idea is that i have a DataRepository Class That i want to only inherit from it speacial methods accourding to the child class, like i want the Client Class to...
6
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... Tried posting this on Build Controls but then saw that's a pretty slow group... Kind of a typical request from product management - they want to be able to swap in different 3rd party...
7
by: splendid9 | last post by:
hello all, i am wrinting unittest for my webservice facade, i could not directly pass the object that i am passing in my original webservice facade in my unit test, so i am trying to create a mock...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.