Hibernate makes Developers Lazy-er

The beauty of Object Relational Mapping or ORM tools like Hibernate is that it allows developers  to write less code by focusing on an object oriented approach to programming rather than a more intensive data table centric approach.  This consequently reduces the amount of SQL coding performed by the developer and this experience, over time,  can negatively influence the developer when modelling the database structure.

Database skills are essential for almost all developers these days with enterprise solutions being designed with data at their core. I believe that whilst the developer remains ‘abstracted’ from the data, they become more complacent in the data model which is likely to result later in poor performance and capacity bottlenecks.

There are plenty of articles and opinions on where business logic should reside within a multi-tiered architecture – in the User Interface, the Middle Tier, the back end or even in the database. There is a case for each of these and all of them as well. Hibernate, or ORM tools suggest the Data Layer should be simply that – data only, and any business logic should be further up in the architecture.

As a consequence,  and from my own experience, I have seen web solutions that make thousands of database calls to load a single web page due to a lack of appreciation of the data model, and a reliance on ORM tools to do the grunt work and gather the required data. For example, row by row iterative queries might perform adequately for a single user in a development or test environment, but what happens when you go live and there are now thousands more records and hundreds of users?

When does the developer stop to continue production data volumes and performance? In many of these cases, and again from my own experience, a simple database index is all that is required to resolve performance issues, but why aren’t developers thinking about the data? because Hibernate is abstracting them too much from the data and developers are losing touch.

It is amazing how many developers know SQL but not Transact SQL (i.e.  how to write Stored procedures).  Cursors used to be “de rigueur” but were not as efficient as hash-tables or temporary tables for iterative data processes. Now the whole process seems to be migrating into the code with technologies like JPA in JAVA and LINQ in Microsoft languages.

Now it is important to highlight that laziness can be seen as a positive attribute in developers. A lazy developer does not want to do things twice and write more code than is necessary so they look for smarter solutions and tools to help get the job done faster. It is just my opinion that some of those tools and techniques are moving developers away from some of the core fundamentals of software development to the detriment of performance.

Comments are closed.