1

Having used frameworks with and without ORM, it seems to me that ORM is a redundant layer of abstraction between your models and database wrapper.

Most frameworks have uniform database wrappers for different database software, so changing software usually won't require a change in code.

Is there any real reason to use ORM? It just seems like adding an un-necessary step.

wyqydsyq
  • 1,992
  • 1
  • 20
  • 28

3 Answers3

4

Well two things... ORM is object relational mapping, that is mapping objects and object types to a database, not necessarily providing a uniform DAL (Database Abstracion Layer) to the backend. So you seem to be working mostly with DALs and not ORMs. Where I work we use ORM to map jobs to a render farm and this allows us to access these same basic objects in any number of applications without storing the data in a hard form (other than in the database). Its is very helpful for when you need to access data in an application agnostic way and share it amongst many other applications in the same form. Long winded, I know-- hope this helps! :)

h4unt3r
  • 846
  • 10
  • 14
2

The purpose of an ORM is to help developers avoid writing lots of repetitive code to map query result set columns into object fields, and back again when you save changed data to the database.

In other words, the ORM is primarily for developer productivity.

See also Why should you use an ORM?

Community
  • 1
  • 1
Bill Karwin
  • 538,548
  • 86
  • 673
  • 828
2

The main reason for use an ORM is related to a non functional requirement, this is that you need port your application between different RDBMS (Oracle, MySQL, PostgreSQL) and reduce the impact of implementation.

If you don't plan to change between RDBMS then maybe you don't need ORM and you are aggregating some complexity and overhead to your application

Ernesto Campohermoso
  • 7,213
  • 1
  • 40
  • 51