Design Patterns in the Test of Time: Façade
Join the DZone community and get the full member experience.
Join For Freea façade is an object that provides a simplified interface to a larger body of code, such as a class library.
the intent of the façade was good: to wrap apis that are poorly designed in something shiny and nice.
in the real world , however, it is an evil pattern that is used to needlessly add abstractions for no particular reason. for example, look at this article .
that sound you just heard is your architecture, it is hiding in the closet, weeping silent tears about emotional and physical abuse that just doesn’t end.
i have yet to see a real case were façade was actually used properly. in most cases, people built a façade because that is how we do things. and because of that, they ended up with things like the one above. it adds exactly nothing, and it horrifyingly complicates the code.
recommendation: avoid this, you really don’t need to do this most of the time, and most implementations are bad.
Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments