Josh Fruhlinger
Contributing Writer

Object orientation: Why bother?

how-to
Jul 14, 20082 mins

We’ve already heard that object-oriented programming is too hard; but could it actually be counterproductive, even for the smarties? UK blogger Simon Johnson fires a shot across the bow of every Java (and C++, and C#) programmer by asserting that OOP is largely ineffective for modern programming. The argument, in a nutshell: most modern applications of any size access RDBMSs, and the object-relational mismatch is one that fundamentally can not be perfectly bridged. Now, there are plenty of articles right here on JavaWorld that will try to show you how to bridge that mismatch, but the fact that there are so many different ways to do it does feed into Johnson’s argument that no way will ever be perfect. I found this bit particularly interesting: So why not use the tools the database gives us natively to do this job? Not only does it provide answers to really complicated queries quickly but it provide transaction support, views of the data, the ability to set complex rules to enforce constraints on entries. Taken together, these are features you’d be simply crazy to ignore. They’re there to help us write solid applications. They’re there to make our work easier! And yet people do ignore it! I honestly think it’s because most developers hate SQL. They’ve got this pathological desire to expunge every last SQL statement from their program. To me, it’s absolutely necessary to understand this language. Just like you need to understand C to understand how high level languages talk to the low level hardware, you need a deep understanding of SQL to understand how databases represent information. You just do, it’s not negotiable.