Valuable advice.  Your assessment of my understanding of the ORM was
quite correct.  That, plus I was working from the TurboGears book
which didn't indicate that I could divorce myself from the ORM,
combined with the general trend towards SQLAlchemy on this list. But
now it sounds like I don't need the ORM's, and as a few of you have
noticed, I certainly don't want them.

Thanks all.

On Dec 5, 2007 12:22 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:

> Most of the problems people have with ORMs stem from them not really buying
> into it, but instead thinking (as you seem to do) "I know about SQL, I know
> about objects - now this ORM thingy will allow me to combine both, adding the
> featuresets". That is not the case.
>
> ORM allows you to use objects and persist them without you bothering about the
> creation of DDL and SQL. With the cost of not being able to fine-tune both of
> them. Usually, they impose constraints like "every row has a unique ID which
> corresponds to my object" to the data model, to allow for easy relationship
> management.  They don't work proper with triggers, stored procedures,
> multi-column-primary-keys.
>
> But ORMs fall flat on their face if what you do is expose all of the
> relational modelling and querying SQL allows you. They don't know how to
> handle several rows represented by one object - as you want them to. They
> fetch all columns or lazily one after another, or all together - which makes
> some people shudder. And they don't allow for arbitrary gathering of columns
> from joined tables.
>
> I'm a SO-user, for a mid-sized TG-app with a fairly elaborate data model -
> some twenty classes or so. I _never_ hit a real road-block with SO. I'm just
> happily coding away in Python, no bother what SQL will result from that.
>
> And thus it saves me tremendous amounts of time when designing the app.
> Granted, when I refactor later in the product cycle, I have to get dirty and
> write my table altering statements. But at least for testing & coding, I
> don't bother the DB a single second.
>
> But as others also already pointed out: TG doesn't impose an ORM layer on you.
> The newest 1.0.4 beta doesn't even install one anymore. Just point your app
> to a DB and get happy. but do yourself a favor - either embrace ORM, or keep
> away from it - shoehorning it into generating the SQL you believe ist best
> (and actually might be - the question is: how much worse is going the ORM
> way) won't make you happy - as you seem to notice :)
>
> Diez

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to