Surprised when I heard some people saying “Patterns suck”, I was eager to know why some people hate these precious guidelines which save us from reinventing the wheel, letting us using it.
Fortunately after just few days I had to work with some confident people, known as pattern-lovers. Having a lot of technical knowledge, they were used to remembered the names of patterns–and there authors as well–on finger tips. People, you can speak technobabble with, for not just hours but for days. In the first place, I admired them and found myself among knowledgeable people.
Then I found something strange, besides all their knowledge they had very few success stories and their management was not satisfied with their problem solving skills.
I had started observing the causes of their failure. Mean while I had to design an architecture for a coming enterprise project. I started scaffolding by enhancing and optimizing my legacy libraries and framework with my team. I asked these people to review my approach to let my approach become foolproof.
Geeks love technicalities so I got a prompt response and they started highlighting the weaknesses, I was very glad as I got a chance to improve. But unexpectedly most of the issues identified are as follows:
Geeks: Aren’t you using NHibernate?
Me: Nope, I personally admire NHibernate for it’s pure objects and database independence but I think that this application do not have complex business logic, instead it comprises of complex reports which is not a specialty of NHibernate. While our framework provides Report Factory and configuration as well tiered approach for reporting. Another reason is that our expertise i NHibernate do not allow us to use it in a time-critical project at this stage.
Geek: What? Do you know where NHibernate came from, it’s a port of Hibernate, being used in the most powerful language Java. It has nothing to compete with Microsoft.
Me: Yes, I agree that Jave and it’s platforms are a lot more mature but every language or technology has some of its own specifications and advantages. Our framework and libraries are optimized with the objects provided with .Net. Our wrapper classes exploiting some new features provide in the laster version of .Net.
Geek: Hey don’t use ADO.Net objects, they do nothing but violates layering These objects are a mess. You should use pure objects that’s why I recommended you to use NHibernate.
Me: I think it depends that how are you using them, in our scenario they are completely database independent because they are boxed in generic objects and are created by Abstract Factory so we can enjoy Inversion of Control, Polymorphisms, and Database Independence.
Geeks: These libraries are not open source, you don’t know what they have written in it.
Me: I admire the benefits of open source but these object are rich, free, built-in, tested and performing well in enterprise applications. I do not very often use them but I found them very useful in such kind of applications.
Geeks: You incorrectly applied this pattern; let me show you the documentation.
Me: This pattern like other patterns have different applications, I am following this approach because it performs well in this scenario. This flexibility is also allowed by experts.
Geek: No, patterns should be followed as is. They are not to be changed for performance or whatever. And remember enterprise applications, built on great technologies like EJB, looks graceful even if they are not enough performant.
Geek: Increase your number of layers like we have did in that application. You have not decoupled enough.
Me: Yes previously I do have the same number of layers but I found it as an overkill in this project, so I modified this version for medium-sized performance-hungry applications.
Geek: And why did you coupled these two major tiers, this is an unacceptable violation of N-Tier Architecture
Me: No, these are still two different layers, but I am keeping them in a single project during development as most of the developers are working on both layers. They still can be deployed on different servers.
Geek: I’m still not satisfied, a lot patterns have not been used, recommended by our gurus and we follow them because we know they are the best.
Me: They might have recommended it for some different type of project and this approach may be suitable in that particular scenario.
Geek: We found their practices the best in all type and size of projects, whatever, it’s not that simple you think it is, you have to add a lot more omplexity.
Me: May be you are true as I found you a lot more knowledgeable but I learned and beleive that a complex system that works is invariably found to have evolved from a simple system that
… that’s how I got my answer that “why people hate patterns?”