Object-Relational Mapping

No, not secret CIA crap.. but just about as tough to crack for most of us. He's got it all, css, html, xhtml, php.. you name it!

Moderator: Zorro

Object-Relational Mapping

Postby Bullet Magnet » October 26th, 2013, 3:10 pm

ORMs are my newfound love. They truly make the birth of my 3rd child look second-rate.

Zorro, do you use these types of tools? Got an opinion on them? I love cutting my data access layer development time down to virtually nothing. Beautiful, just beautiful.
User avatar
Bullet Magnet
Squad Member
 
Posts: 1472
Joined: February 6th, 2011, 5:53 pm

Re: Object-Relational Mapping

Postby BlackCat » October 26th, 2013, 3:28 pm

I think Zorro died.
User avatar
BlackCat
 
Posts: 1674
Joined: February 12th, 2011, 12:05 pm

Re: Object-Relational Mapping

Postby Zorro » October 28th, 2013, 10:00 am

ORMs are overhead, inefficient, and result in lots of unnecessary layers in an application. For a small database with a half dozen tables, you likely won't notice the layers and inefficiency. For me at least, when I'm working with a database with tens of millions of records and 50 or so tables, I've found ORMs to be more trouble then they're worth. Google "object-relational impedance mismatch" for more information. Long story short, I abhor ORM solutions. This is, of course, a highly controversial opinion.
Research shows that one in three Clinton supporters are just as stupid as the other two.
Zorro
Squad Member
 
Posts: 543
Joined: February 5th, 2011, 12:25 pm

Re: Object-Relational Mapping

Postby BlackCat » October 28th, 2013, 10:02 am

He hath spoken.
User avatar
BlackCat
 
Posts: 1674
Joined: February 12th, 2011, 12:05 pm

Re: Object-Relational Mapping

Postby Bullet Magnet » October 31st, 2013, 4:10 pm

I figured that was the reply I would get.

I read Wikipedia's page on object-relational impedance mismatch. I understand the problems with the ORM approach, but to me, they don't seem to outweigh the benefit of cutting development time down significantly. It seems to me that all of those issues have possible workarounds. Assuming ORM is actually limiting some functionality, it's not as if you can't integrate both approaches.

I suppose I'll learn much more when I join a professional development team, but I'll be using them for my own applications as much as I can. I suppose your opinion will also be influenced by the ORM technology you have available. The .NET languages have recently introduced the Entity Framework Model, and it's a pretty extensive approach. Something developed by Microsoft that is .NET-language specific has probably given me an unfair, biased introduction.
User avatar
Bullet Magnet
Squad Member
 
Posts: 1472
Joined: February 6th, 2011, 5:53 pm

Re: Object-Relational Mapping

Postby Zorro » October 31st, 2013, 4:36 pm

Well ORM is a hot topic for debate, and my opinion is far from unbiased as I'm mostly limited to my ORM experience in a PHP environment (Doctrine, Propel, and RedBean). The biggest problem I find when using an ORM solution on really large projects is handling records with really complex one-to-many, many-to-one, and many-to-many relationships. All an ORM really does is write [inefficient] SQL queries on behalf of the developer. When retrieving data, it compiles the results into usable objects or arrays. When inserting data, it compiles the objects/arrays into SQL queries. In other words, it's just layers and layers of automation. It sounds cool at first, but I've found it only leads to frustration down the road, since the developer never really knows for sure what's going on further down the stack.

When I built version 1 of my PHP framework (VinePHP), the biggest problem I had to force myself to overcome was to not overly automate things; because the more automated a code library becomes, the less portable it becomes. Like version 1, the second version of VinePHP (currently in the planning phase) is going to expound on the philosophy of less-is-more.
Research shows that one in three Clinton supporters are just as stupid as the other two.
Zorro
Squad Member
 
Posts: 543
Joined: February 5th, 2011, 12:25 pm

Re: Object-Relational Mapping

Postby Bullet Magnet » December 10th, 2013, 12:24 am

Just popping in again to say I have saved so much time in my most recent project with the Entity Framework for C#. :D
User avatar
Bullet Magnet
Squad Member
 
Posts: 1472
Joined: February 6th, 2011, 5:53 pm


Return to El Zorro's casa de la Codes

Who is online

Users browsing this forum: No registered users and 21 guests

cron