object-relational mappers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Diez B. Roggisch

    #16
    Re: object-relational mappers

    Bruno Desthuilliers schrieb:
    Jarek Zgoda a écrit :
    >Bruno Desthuilliers napisa³(a):
    >>
    >>Now my own experience is that whenever I tried this approach for
    >>anything non-trivial, I ended up building an "ad-hoc,
    >>informally-specified bug-ridden slow implementation of half of "
    >>SQLAlchemy. Which BTW is not strictly an ORM, but primarily an attempt
    >>at a better integration of SQL into Python. So while it may feel like
    >>learning the inner complexities of SQLALchemy (or Django's ORM which is
    >>not that bad either) is "wasting brain cells", MVHO is that it's worth
    >>the time spent. But YMMV of course - IOW, do what works best for you.
    >>
    >I like OR mappers, they save me lot of work. The problem is, all of them
    >are very resource hungry, processing resultset of 300k objects one by
    >one can effectively kill most of commodity systems. This is where raw
    >SQL comes in handy.
    >
    The problem here is not about how you build your query but about how you
    retrieve your data. FWIW, SQLAlchemy provides quite a lot of "lower
    level" SQL/Python integration that doesn't require the "object mapping"
    part. "raw SQL" is fine, until you have to dynamically build complex
    queries from user inputs and whatnot. This is where the "low-level" (ie:
    non-ORM) part of SQLAlchemy shines IMHO.
    The same can be said for SQLObjects SQLBuilder. Even if I ended up
    generating SQL for some query that didn't touch the ORM-layer, it helps
    tremendously to write e.g subqueries and such using python-objects
    instead of manipulating strings. They help keeping track of already
    referenced tables, spit out properly escaped syntax and so forth.

    Diez

    Comment

    • M.-A. Lemburg

      #17
      Re: object-relational mappers

      On 2008-04-01 22:40, Aaron Watters wrote:
      I've been poking around the world of object-relational
      mappers and it inspired me to coin a corellary to the
      the famous quote on regular expressions:
      >
      "You have objects and a database: that's 2 problems.
      So: get an object-relational mapper:
      now you have 2**3 problems."
      >
      That is to say I feel that they all make me learn
      so much about the internals and features of the
      O-R mapper itself that I would be better off rolling
      my own queries on an as-needed basis without
      wasting so many brain cells.
      >
      comments?
      I fully agree :-)

      --
      Marc-Andre Lemburg
      eGenix.com

      Professional Python Services directly from the Source (#1, Apr 03 2008)
      >>Python/Zope Consulting and Support ... http://www.egenix.com/
      >>mxODBC.Zope.D atabase.Adapter ... http://zope.egenix.com/
      >>mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
      _______________ _______________ _______________ _______________ ____________

      :::: Try mxODBC.Zope.DA for Windows,Linux,S olaris,MacOSX for free ! ::::


      eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
      D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
      Registered at Amtsgericht Duesseldorf: HRB 46611

      Comment

      • =?ISO-8859-15?Q?Michael_Str=F6der?=

        #18
        Re: object-relational mappers

        M.-A. Lemburg wrote:
        On 2008-04-01 22:40, Aaron Watters wrote:
        >I've been poking around the world of object-relational
        >mappers and it inspired me to coin a corellary to the
        >the famous quote on regular expressions:
        >>
        >"You have objects and a database: that's 2 problems.
        >So: get an object-relational mapper:
        >now you have 2**3 problems."
        >>
        >That is to say I feel that they all make me learn
        >so much about the internals and features of the
        >O-R mapper itself that I would be better off rolling
        >my own queries on an as-needed basis without
        >wasting so many brain cells.
        >>
        >comments?
        >
        I fully agree :-)
        BTW: Some people implemented O/R mappers above python-ldap. All
        implementations I saw up to now are falling short regarding the
        complexity of the LDAP attribute sub-types, the syntactical rules for
        attribute type descriptive names and attribute name aliasing. So first a
        developer has also to evaluate whether a O/R mapper is really complete
        before using it.

        Ciao, Michael.

        Comment

        Working...