Java Code Geeks

Saturday, September 4, 2010

My experience with some of the famous anti patterns in Software

There are two anti patterns that most of the software companies suffer from. These two anti patterns are so deep in the lifecycle of a software company that at times it becomes impossible to get rid of them.
If you ever work with a DBA who has more than 10 years of experience, you will notice one thing - they usually think anything and everything can be solved using Relational database system. I am not against relational database, it is the best thing that has ever happened to software. The concepts of relational database is solid and full proof, although this does not mean we should always think of database to solve any problems. If the data that is going to get stored in the database is not of relational in nature, why to force it to be stored in a relational database? This is what exactly google found out and came out of BigTable which is essentially a key/value pair (or hashtable). This anti pattern is known as "Golden Hammer" anti pattern. I can bet even many of us are suffering from this anti pattern. For example, in the next team meeting when someone tells you a problem, watch out what is your response? Are you offering the same solution to many different problems? Like one of my ex-colleague knew Hibernate very well, any problem you mention to him, there is a large chance he will apply hibernate to solve that problem !! Like one core Java developer will try to use Java to parse log files instead of 10 lines of Perl code ? Like one JEE developer uses EJB always whether it is required or not?One of my friend told me once that he is always using handful of "design patterns" though he knowns them all !!

One can be free from this anti pattern only if she knows many languages, many technologies and more importantly if she follows Richard Feynman's philosophy of leading life with an open palm. If we do not lock ourselves into favorites and make room for new ideas, then only we can be free from this anti pattern.

There is one more anti pattern which can be found at the team or organization level than that of at the individuals. It is called "vendor lock-in". Like one shop might be completely into Oracle database and using Oracle pl/sql procedure with business logics into it. Once I worked for a team where everyone from director to junior developer were comfortable writing business logics in the pl/sql code instead of at the application layer using Java or .Net. When I mentioned this to the director that it might become very costly if tomorrow your organization thinks they are not going to do any business with Oracle anymore, what will happen to all these code ? You might have to port them to Sybase or some other database vendor, instead, keep the logic at the application layer. He almost looked at me as if I am an alien and I do not know anything about how software works.

These are the reasons for which I like google. This is the only company that tries to keep an "open palm" strategy and comes up with their own systems - like Bigtable for their database.
To be a better software developer or architect, we should learn not to create favorites and keep an open mind so that we can welcome new ideas.

1 comment:

Bhagath Ganga said...

Hey Majumdar,

This query is not related to this post. I have an issue with the axis2 client giving "connection time out" after a number of succesful invocations. I have seen that you posted your query on Amila's blog. Was wondering if you got to know the soultion to the problem. It would be great if you could share the solution if you solved the problem.