3

After working a while with Codeigniter, I am totally in love with the ActiveRecord way of writing mySQL queries. Now, when working on another non-codeigniter project I've been recommended to use an ORM to handle the DB mapping which sounds great, but after looking into Propel & Doctrine, I have become quite afraid of the additional configuration files containing the database structure, more or less.

Why does these ORM:s define the database structure and what advantage has it over an non-defined ORM like the one that's bundled with codeIgniter?

hakre
  • 193,403
  • 52
  • 435
  • 836
Industrial
  • 41,400
  • 69
  • 194
  • 289

1 Answers1

2

FYI, there was a thread about this a while ago. The gist of it is that ORMs (ActiveRecord is an common ORM pattern) help enable database independence and quicker access to common queries. Downside is that ORMs are "heavier" than straight SQL. For most apps, 90% of your data access is pretty standardized so ORMs help with time to market.

ORM and Active Record Pattern in PHP?

Community
  • 1
  • 1
zeroSkillz
  • 1,448
  • 1
  • 11
  • 17
  • 1
    It depends on the design, Some ORMs are designed to value ease of use over speed. In the Java world, The Hibernate ORM requires an incredible amount of XML configuration, but is amazingly flexible and quite performant. In CakePHP the ORM config is ridiculously simple, but the drawback is that the ORM code is much more heavyweight. My opinion is that Ease of Use is a better design for the current state of the industry. Programmer time > Hardware Costs, so it's a much better use of resources to use the technology that saves 50% of a programmers time vs an ORM that is 50% faster. – zeroSkillz Feb 09 '11 at 19:14