Why ORM? ’cause:

Hi again, a few hours ago I have read a question about ORM mapping for java . He wonders why  and when this technology is chosen.

Disclaimer: I am omitting the case, when your database is just a storage for a CRUD apps. I am talking about complex applications, when stored procedures are used very extensively, like Oracle’s PL/SQL.


Here comes the arguments :

I have some questions, like:
- What is your point to use ORM instead of plain SQL?
- What value ORM brings to you and how easy is to maintain the code, continue project?
- How easy new comers are getting along with your project?
- How quick and easy you update your system?
- What the performance is speed and resource usage wise?
- How generated SQL is efficient for your database and what is DB load does it provide?
- What is your way to cope with the situation, when you have a custom stored procedures package in your DB?

And the most important:
- If you ask yourself really honestly, so are you REALLY REALLY happy with ORM, rather than go with plain JDBC/SQL? I am talking in general principle, not just from some particular product perspective, that requires ORM to be used.

Here I see an out of date perspective:  “We have everything in database and database is faster and easier to develop then java”

  • ALL of the ORM tools  have code generation utility  both binary and source code that saves lots of time and effort.
  • They force you to put some abstraction layer between your Database and business layer. Abstraction is always GOOD unless it is extreme
  • Interoperability: you can change your database vendor more easily even you can use different for your development and production enviroment!
  • Enable more methodology: yes you can use interceptor soft-caches, clusters, aspects, listeners,notifiers and so on …
  • Maintainable: which one is more maintainable code: your database, plsql, resultset or your domain objects and business layer !!!!
  • Industry standards and trends: you can find more innovative tools and support when you are  following trends :) {jsf,seam}
  • Learning curve: new graduates know more about POJOs objects then SQL/PLSQL and vendors
  • Enables SQL if it is needed
  • for more features:hibernate features and  toplink features

of course do not forget:

  • ORM is efficient  only when dealing object one by one not fits for bulk operation and summary reports
  • first learn: you should learn your tool to avoid pitfall
  • you can always chose a framework like IBatis for such implementation

you can find discussion:

linkedin discussion

have a nice day :)

Related Posts

  1. Clean database schema with inheritance
    •  Wonderer
    • October 22nd, 2008
  1. In which LinkedIn Group is this discussion going on?
    As I tried the link it said, you are not a member of this group, but it didn’t say which group.. Not your bug, I know :)

  1. No trackbacks yet.