ORMs comparisons/complaints.


D

Daniel Pitts

Hey everyone,

This is cross-posted to cl.java.programmer and cl.php.

I've been doing some thinking about my experiences with various ORMs,
both positive and negative. I find that I often stretch systems to
there limits, and end up doing a lot of meta-programming to solve
problems that I've always felt should have been solved by the core
libraries. Mostly to follow DRY and KISS principals in the core
business code.

I'm curious if others' have found the same things I have, or if they've
been satisfied doing things other ways, and if so what ORMs they use.

I've had experience with the following Java ORMs:
* Hibernate (version 3, using Annotations for instance)
* Ibatis (many years ago, don't remember the version. around 2006)
* Straight JDBC. Not exactly an ORM :)

And then one non-Java ORM: Doctrine, which is modeled after Hibernate,
including most of its flaws, but missing some of its features.


So, my question to the groups, what ORMs have you used, and what did you
like and hate about each of them? I'm not trying to start a flame war,
so please keep it to personal experiences with projects which used them.

I'm interested in use-cases from simple small one-off applications to
complex enterprise-level systems, and highly-scalable systems.

Please include details like "it's easier to maintain <x> type of changes
with our approach, but <y> is very difficult" etc...

Thanks for your consideration,
Daniel.
 
Ad

Advertisements

A

Arne Vajhøj

This is cross-posted to cl.java.programmer and cl.php.

I've been doing some thinking about my experiences with various ORMs,
both positive and negative. I find that I often stretch systems to
there limits, and end up doing a lot of meta-programming to solve
problems that I've always felt should have been solved by the core
libraries. Mostly to follow DRY and KISS principals in the core
business code.

I'm curious if others' have found the same things I have, or if they've
been satisfied doing things other ways, and if so what ORMs they use.

I've had experience with the following Java ORMs:
* Hibernate (version 3, using Annotations for instance)
* Ibatis (many years ago, don't remember the version. around 2006)
* Straight JDBC. Not exactly an ORM :)

And then one non-Java ORM: Doctrine, which is modeled after Hibernate,
including most of its flaws, but missing some of its features.


So, my question to the groups, what ORMs have you used, and what did you
like and hate about each of them? I'm not trying to start a flame war,
so please keep it to personal experiences with projects which used them.

I'm interested in use-cases from simple small one-off applications to
complex enterprise-level systems, and highly-scalable systems.

Please include details like "it's easier to maintain <x> type of changes
with our approach, but <y> is very difficult" etc...

My experience is that ORM is good for cases where all of the
following apply:
- changes of single rows or simple queries
- database is designed for ORM or are relative simple

ORM is obviously not intended for changing large number of rows
(bulk operations).

For very complex queries one end up working around limitations
in the QL to achieve what is easy to do in SQL.

Old legacy databases with a bad design is very difficult to
map to ORM and the result often perform very poorly.

ORM's used:
Java - entity EJB's, Hibernate, JPA
.NET - NHibernate, LINQ to SQL, EF

Non ORM used:
Java - JDBC
.NET - ADO.NET
PHP - mysql, mysqli and PDO extensions

Preference:
Java - JPA (due to standard, features and ease of use)
.NET : NHibernate (due to features and ease of use)

Arne
 
J

Jerry Stuckle

Hey everyone,

This is cross-posted to cl.java.programmer and cl.php.

I've been doing some thinking about my experiences with various ORMs,
both positive and negative. I find that I often stretch systems to
there limits, and end up doing a lot of meta-programming to solve
problems that I've always felt should have been solved by the core
libraries. Mostly to follow DRY and KISS principals in the core
business code.

I'm curious if others' have found the same things I have, or if they've
been satisfied doing things other ways, and if so what ORMs they use.

I've had experience with the following Java ORMs:
* Hibernate (version 3, using Annotations for instance)
* Ibatis (many years ago, don't remember the version. around 2006)
* Straight JDBC. Not exactly an ORM :)

And then one non-Java ORM: Doctrine, which is modeled after Hibernate,
including most of its flaws, but missing some of its features.


So, my question to the groups, what ORMs have you used, and what did you
like and hate about each of them? I'm not trying to start a flame war,
so please keep it to personal experiences with projects which used them.

I'm interested in use-cases from simple small one-off applications to
complex enterprise-level systems, and highly-scalable systems.

Please include details like "it's easier to maintain <x> type of changes
with our approach, but <y> is very difficult" etc...

Thanks for your consideration,
Daniel.

Is there a PHP question in there? I don't see one...

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 
A

Arne Vajhøj

Is there a PHP question in there? I don't see one...

Doctrine is PHP. And the question is open ended so other PHP
ORM's could be included in discussion.

Arne
 
J

Jerry Stuckle

Doctrine is PHP. And the question is open ended so other PHP
ORM's could be included in discussion.

Arne

I still don't see a PHP question here. I see some product questions -
which would be better suited in a newsgroup for those applications.

Just because something uses PHP does not mean it is appropriate for a
PHP language newsgroup.

But I know some people don't believe in segregation of newsgroups and
think anything should be able to be asked in any newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 
A

Arne Vajhøj

I still don't see a PHP question here. I see some product questions -
which would be better suited in a newsgroup for those applications.

Just because something uses PHP does not mean it is appropriate for a
PHP language newsgroup.

But I know some people don't believe in segregation of newsgroups and
think anything should be able to be asked in any newsgroup.

ORM's are not applications. They are libraries.

And since it is question asking for comparison, then a group
for a specific library is not a good choice.

Instead a group with people with experience and interest in
different ways of database access from PHP is needed.

comp.lang.php does not seem that far fetched.

Obviously comp.lang.php.databaseaccess or comp.lang.php.databaseaccess.orm
would be even better if such exists.

Arne
 
Ad

Advertisements

J

Jerry Stuckle

ORM's are not applications. They are libraries.

And since it is question asking for comparison, then a group
for a specific library is not a good choice.

Instead a group with people with experience and interest in
different ways of database access from PHP is needed.

comp.lang.php does not seem that far fetched.

Obviously comp.lang.php.databaseaccess or comp.lang.php.databaseaccess.orm
would be even better if such exists.

Arne

Yes, an ORM-related newsgroup would be more appropriate. There you have
people who know the advantages and disadvantages of various ORM's.

Few, if any, in the language-related newsgroups will have used an ORM,
and if they have, they have very limited experience.

But as I said - some people think any question can be asked in any
newsgroup, no matter how thin the connection. But others prefer to
direct people to appropriate newsgroups, where they will get GOOD
answers from knowledgeable people.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 
A

Arne Vajhøj

Yes, an ORM-related newsgroup would be more appropriate. There you have
people who know the advantages and disadvantages of various ORM's.

ORM's are language specific. So it would need to be a PHP ORM group
to cover PHP.

Does one exist?
Few, if any, in the language-related newsgroups will have used an ORM,
and if they have, they have very limited experience.

That depends on the language.

In languages like Java and C# it would be >90% that have used an ORM.

It is probably much less in PHP as ORM's are not as widely used
in the PHP world.

But I suspect that Daniel even may be interested in knowing more
about why it is so.

Arne
 
M

Marcel Müller

This is cross-posted to cl.java.programmer and cl.php.

The topic is unlikely to fit to php. F'up to java only.
I've been doing some thinking about my experiences with various ORMs,
both positive and negative. I find that I often stretch systems to there
limits, and end up doing a lot of meta-programming to solve problems
that I've always felt should have been solved by the core libraries.
Mostly to follow DRY and KISS principals in the core business code.

First of all you need to mention what ORMs are designed for. They are
intended to make SQL databases suitable for OO programming style and/or
non-relational data models. At the end OO expressions are turned into
SQL and then to an execution plan.
From that you can see that there is exactly one thing superfluous in
this scenario: SQL. It is the bottleneck where all expressions must fit
to. But it does not add any functionality, quite the contrary. It is
just a emulation level for compatibility, like a SATA adapter enables a
SATA drive to be used with an IDE port.

You see, I am not really a friend of ORM. If a relational data model
does not fit your needs, you first should consider to use a non
relational database, rather than to normalize the data model to fit into
a relational DB, and use an ORM to hide that from the application layer.

ORMs are known to slow things down. I don't think that this is true in
general. But the ORM layer makes some trivial looking expressions
amazingly complex. So it is not that easy for the programmer to estimate
the complexity of a code block, without knowledge about the entire ORM
layer and the base data model in SQL. In fact I have redesigned many
code parts because of this.

There is one advantage. Adding attributes to the data model is quite
simple with an ORM. No need to do redundant changes at many locations.
But any document DB will provide this as well without the need for SQL
and an ORM.

Of course, if you are stuck with an SQL DB for some reason and you need
to adapt to an OO application layer ORM might be a choice. But if the
data model in the DB is not intended for ORM usage, you won't get happy,
because there are almost always properties of the data model that are
not correctly modeled in SQL.


However, to get more detailed information you need to phrase your
questions more precisely. What are your topics of interest? Performance?
Maintainability? What kind of data model do you intend to use? Many
entities? Or many properties? What kind of relations? Polymorphism?


Marcel
 
J

Jerry Stuckle

ORM's are language specific. So it would need to be a PHP ORM group
to cover PHP.

Does one exist?


That depends on the language.

In languages like Java and C# it would be >90% that have used an ORM.

It is probably much less in PHP as ORM's are not as widely used
in the PHP world.

But I suspect that Daniel even may be interested in knowing more
about why it is so.

Arne

If you want, you can talk all you want about it in c.l.j.p. But this
does not belong in c.l.p.

FUP set to c.l.j.p only.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 
C

Christoph Michael Becker

That *might* be true for compl.lang.php. However, ...
If you want, you can talk all you want about it in c.l.j.p. But this
does not belong in c.l.p.

.... I can't see why this topic doesn't belong to comp.lang.php.
FUP set to c.l.j.p only.

FUP ignored.
 
Ad

Advertisements

K

Kevin McMurtrie

Daniel Pitts said:
Hey everyone,

This is cross-posted to cl.java.programmer and cl.php.

I've been doing some thinking about my experiences with various ORMs,
both positive and negative. I find that I often stretch systems to
there limits, and end up doing a lot of meta-programming to solve
problems that I've always felt should have been solved by the core
libraries. Mostly to follow DRY and KISS principals in the core
business code.

I'm curious if others' have found the same things I have, or if they've
been satisfied doing things other ways, and if so what ORMs they use.

I've had experience with the following Java ORMs:
* Hibernate (version 3, using Annotations for instance)
* Ibatis (many years ago, don't remember the version. around 2006)
* Straight JDBC. Not exactly an ORM :)

And then one non-Java ORM: Doctrine, which is modeled after Hibernate,
including most of its flaws, but missing some of its features.


So, my question to the groups, what ORMs have you used, and what did you
like and hate about each of them? I'm not trying to start a flame war,
so please keep it to personal experiences with projects which used them.

I'm interested in use-cases from simple small one-off applications to
complex enterprise-level systems, and highly-scalable systems.

Please include details like "it's easier to maintain <x> type of changes
with our approach, but <y> is very difficult" etc...

Thanks for your consideration,
Daniel.

I don't like ORM utilities much because they rarely model all of the
complex relationships and behaviors, for better or worse, that may exist
in SQL. You end up spending at least as much time working around those
limitations as time initially saved.

Simpler data works fine in ORM, but simpler data is isn't the complex
task ORM tries to solve.

That leaves many ORM utilities as too enormous, too complex, too slow,
and still a poor fit for SQL. I see ORM as potentially being an
excellent fit for document stores but I have little experience with
those.
 
J

Jerry Stuckle

"Jerry Stuckle" wrote in message
If you want, you can talk all you want about it in c.l.j.p. But this
does not belong in c.l.p.

FUP set to c.l.j.p only.

Jerry, could you please post a copy of the certificate you received when
you were appointed the owner of c.l.p? Either that or the "Resident
Troll Award" would be suitable.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]

Qu0ll,

Could you please show where you EVER have posted in comp.lang.php?

We have a good group here. Don't ruin it by making off-topic posts. If
you what to see what's appropriate, please refer to the charger for the
newsgroup.

This is comp.LANG.php, not comp.ORM.php.

Fupped to c.l.j.p. for the TROLL's benefit.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 
J

Jerry Stuckle

"Jerry Stuckle" wrote in message
If you want, you can talk all you want about it in c.l.j.p. But this
does not belong in c.l.p.

FUP set to c.l.j.p only.

Jerry, could you please post a copy of the certificate you received when
you were appointed the owner of c.l.p? Either that or the "Resident
Troll Award" would be suitable.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]

Qu0ll,

Could you please show where you EVER have posted in comp.lang.php?

We have a good group here. Don't ruin it by making off-topic posts. If
you what to see what's appropriate, please refer to the charger for the
newsgroup.

This is comp.LANG.php, not comp.ORM.php.

Fupped to c.l.j.p. for the TROLL's benefit.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 
J

Jerry Stuckle

"Jerry Stuckle" wrote in message
If you want, you can talk all you want about it in c.l.j.p. But this
does not belong in c.l.p.

FUP set to c.l.j.p only.

Jerry, could you please post a copy of the certificate you received when
you were appointed the owner of c.l.p? Either that or the "Resident
Troll Award" would be suitable.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]

Qu0ll,

Could you please show where you EVER have posted in comp.lang.php?

We have a good group here. Don't ruin it by making off-topic posts. If
you what to see what's appropriate, please refer to the charger for the
newsgroup.

This is comp.LANG.php, not comp.ORM.php.

Fupped to c.l.j.p. for the TROLL's benefit (correct one this time)


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 
Ad

Advertisements

M

Michael Vilain

Qu0ll said:
"Jerry Stuckle" wrote in message
If you want, you can talk all you want about it in c.l.j.p. But this does
not belong in c.l.p.

FUP set to c.l.j.p only.

Jerry, could you please post a copy of the certificate you received when you
were appointed the owner of c.l.p? Either that or the "Resident Troll
Award" would be suitable.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]

It's amusing what I miss after I plonked him. Not much, still, from what
I can tell.
 
S

Silvio

I did several stabs at ORMs in some small toy projects but have mainly
use ORMs working on existing projects using ORMs (both Hibernate and
Toplink) that where performing extremely poorly and had become almost
impossible to maintain and extend. I was then called in to take the ORM
out of the system as much as possible. This always consisted of creating
alternative tools for interacting with the RDBMS that the programmers
could use to rewrite the must critical and/or problematic system parts.

So you could say I have mainly negative experiences I could share. To
put it bluntly: I think ORM is a bad idea in general. I dig OOP for
modelling the transient behaviour of a running program but find the
relational model far superior for modelling data. I also find it
beneficial in general to think of data and programs working on data as
separate things.

ORM is a mechanism to help you do it the other way around, and a poor
one at it. If you want to persist objects use an object database or
serialize to some NoSQL store. If you want structured data in an RDBMS
don't degrade it into a pile of persisted objects.

Silvio
 
J

Jerry Stuckle

"Jerry Stuckle" wrote in message
Wow Jerry, your response was so weak you felt the need to post it 3 times!


OK, I get it, people who have never posted in a particular group are not
allowed to comment. Got it. My mistake, I see you really *do* own the
group!

People with PHP questions are welcome. But we have enough TROLLS
without you. You do not know the group, the history or the members.
But you know better than the regular readers what is best for this
newsgroup.

How like the TROLL you are so well-known as! No wonder you refuse to
use your real name and use a gmail address.
Fupped to c.l.j.p. for the TROLL's benefit (correct one this time)

Not sure how you benefitted from that but thanks for the admission.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]

FUP reset for the TROLL's benefit.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 
Ad

Advertisements

J

Jerry Stuckle

"Jerry Stuckle" wrote in message

There's one in every newsgroup. The one who thinks they own it. The
one who thinks their opinion is more important than any other. The one
who thinks they have the right to say who posts and who doesn't post.
The one who treats newbies like they have committed a federal offence.
The one who spends more time picking up on grammar or capitalisation
than actually helping others. And the one whose opinion of themselves is
of the rock star of all rock stars.

Thank you Jerry for putting up your hand and letting newcomers know who
this person is for c.l.p so quickly!

Yes, with your presence has added one more TROLL to this newsgroup. We
don't need you. Go back and ruin your java newsgroup.

And FYI, I am NOT the only one who feels this way. The majority of the
non-trolls in this newsgroup feel the same way. I'm just the first one
to speak up in this thread.

I'll let you have the last word. TROLLS always need that to feed their
fragile ego. That's why they're afraid to use their real names or a
non-gmail et.al. address. They're terrified someone will find out who
they really are!

FUP'd to comp.lang.java.programmer, although I know the TROLL will
change it again. Why do you guys even put up with him?


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top