At what point do you think “why am I doing this?”

When I started a new job, I was told I would be working on a 3-tier architecture. I was a little bemused when I first laid eyes on the code and discovered that 2 of the tiers were entirely pointless!

In a traditional 3-tier architecture (using SQL) your presentation layer obtains a business object from the business layer, which in turn is responsible for communicating with your data repository, perhaps using an ORM, or raw SQL, or stored procedures, or whatever.

In this project, the presentation layer would call a method in the business layer, which was a wrapper for a method in the data-layer, which was itself a wrapper for a stored-procedure. There were about 300 stored procedures, so there were 600 redundant methods, meaning around 6000 redundant lines of code, spread across 14 assemblies, and close on 100 classes.

Now, I can understand how someone could misinterpret the n-tier design philosophy, and implement it this way. I’ve done some superbly stupid things in my time. It’s called learning. What I can’t understand is how you can keep with this approach for years at a time. I mean, at what point do you sit down and think “Why am I doing this? What benefit is it providing me with?”.

Even if you do understand the design, the framework, the language, the tool, the whatever, and are using it exactly as it was intended, you should still be asking this question and, if you don’t get a compelling answer, stop doing it! It’s as simple as that.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s