Midbook patterns crisis: Façade is and ain’t
I decided to comment to some of the comments in the blog in a full blown post, because they are quite important.
- View Model is not a façade. It doesn’t allow any operation, and it doesn’t simplify things. It merely give you an easy access to aggregate information.
- No, every class is not a Façade. I don’t care if “it provides simplified interface to a larger body of code”. If everything is a façade, then façade is meaningless.
- No, Web Request is no a façade. Sure, it hides a lot of details about TCP, but that isn’t its point. Web Request implements HTTP spec, and that isn’t a façade at all.
- Web Client / Tcp Client / Tcp Listener are facades – they drastically simplify how to work with sockets. Good facades, too, because when you need to do more, they don’t block you.
- NHibernate ain’t a façade – it hides ADO.NET, sure, but it also does a lot more then just that.
The whole point of this series of posts was not to talk about patterns. If you want to do that, go ahead and read the books. My attempt is to go and talk about how the patterns are actually used. In practice, in real code.
Sure, in the real world, patterns aren’t used as per their text book definition. That doesn’t mean that we should look at the text book definition. That means that we need to look at how they are actually used! I am not writing a series of posts talking about the problems in the patterns, and that is important. I am writing about the problems in how people use them.
Comments
Cheers Ayende - I find this approach to discussing patterns very useful, often I find this sort of view of pattern implementation overlooked its nice to understand about usage and pitfalls rather than text book definitions, especially as i am very new to it in the scheme of things
Good to hear some common sense as opposed to Pattern Evangelists that love to swear by their pattern holy bible and can split hair for pages long on forums without ever touching real life code (guys in those linkedin software design groups, I'm looking at some of you.)
Real world usable techniques should take precedence over academic definitions IMHO.
Comment preview