Re: Facade
- From: "Ed" <iamfractal@xxxxxxxxxxx>
- Date: 29 May 2006 10:05:12 -0700
Padu wrote:
Hi everybody,
I've been thinking about the facade pattern lately, and it seems to me that
one very good use for it is to implement one facade in every subsystem, like
a summary.
In a case like this, every subsystem (a namespace for example) would have a
"denormalized" facade that would present the most commonly used services
from that namespace, simplifying things for 90% of clients in other
namespaces.
What do you think of it?
Cheers
Padu
A couple of points.
Unfortunately my girlfriend has my copy of Design Patterns at the
moment (I'm beginning to suspect that a hostage situation is brewing,
but that's another story), so I can't quote scripture, but it's
important to note that a Facade is not just one interface.
Ok, I'm using the term, "Interface," in the Java-sense; perhaps more
general to say, "Abstract class." The Facade pattern recommends that
the Facade can be a collection of abstract classes providing access to
the name space in question. I only mention this because a couple of the
mails in the thread seemed to suggest otherwise, certainly in terms of
the, "Narrowness," of the Facade. I may have interpretted wrongly.
Secondly, I don't know what you mean by a, "Denormalized," Facade -
care to clarify?
On the whole, I think Facading your name spaces is an excellent idea,
and can yield even more value if you then store the Facade (i.e.,
collection of abstract classes) somewhere removed from the name spaces
to which they give access, thus separating your Facades the structure
of your hierarchical name space (and empowering, "Program to an
interface repository, not an implementation repository").
Simple example given here:
http://www.edmundkirwan.com/servlet/fractal/frac-page70.html
The eminent Unlce Bob mentioned, "Most subsystems are not
"facadeable", and you should not expend effort into making them fit
into a facade." This worries me a little, so I hope Bob's, "Subsystem,"
is not the, "Name space," I mention, as a name space should contain
logically related behaviours that you wish to encapsulate away from the
rest of the system: almost by definition, a name space should be
Facadable, as otherwise there's too much disparate behaviour lumped
together.
..ed
--
www.EdmundKirwan.com - Home of The Fractal Class Composition
.
- References:
- Facade
- From: Padu
- Facade
- Prev by Date: Re: Searching OO Associations with RDBMS Persistence Models
- Next by Date: Re: sequence diagram for observer pattern
- Previous by thread: Re: Facade
- Next by thread: Mixins, Multiple Inheritance, Interfaces
- Index(es):
Relevant Pages
|