History of object oriented data access

When object orientation was applied to relational data this was the outcome over the last 20 years.

 

1994 Toplink
2000 Java data objects
2001 hibernate
2005 n Hibernate
2007 .NET 3.5 with LINQ
2008 Entity Framework and Sub Sonic
2010 .NET 4 and Entity Framework v4 capable of working with Stored Procedures

What is a Object Relational Mapper(ORM)?

It is a tool like any other in software which solves the problem of how to get real world objects which can have massive complexity into a relational table structure. This would normally be considered by a developer upfront when they are creating a feature and is subject to fragility and assumption.

If a developer has a good grasp of good database design and practice. Then using an ORM can be very worrying because manipulating data has always been done as close to it as possible to maximise efficiency. Typical concerns are security, re-usability, performance, maintainability, and supporting a live application.

All of these concerns are addressed by ORM. But if you have massive amounts of business logic and conditions in SQL Stored Procedures it wouldn’t make sense to move it because then you are exchanging a bunch of trade-offs for another bunch of different trade-offs. However it is my understanding that where feasible in a project supporting the use of an ORM. The reduction in time spend writing plumbing code, more than makes up for the issue of reverse engineering domain logic from T-SQL and re-engineering it. It also presents an opportunity for assumptions and misunderstandings to be clarified with the domain experts making more developers better domain experts. With the added bonus of distributing project knowledge across the team enhancing flexibility in times of added constraints.

Let’s consider the fact that you’re more prone to mistakes when you limit yourself to one way of doing things. Perhaps there is a case for any business to try something purely because it is an alternative. Also the fact that the more code in a project the less maintainable the project will become, implying, code reduction is crucial to return on investment.

If you are using stored procedures, or reusing them over multiple projects you owe it to the business to give Object Relational Mapping a punt.

As shown above ORMs are a very recent development and the subject of controversy due to their perceived ignorance of database design. It is true they are powerful but as with all powerful things they should be used with a measure of caution and understanding.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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