Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Reflections on the design of a pure-Moose web app...

by zby (Vicar)
on Mar 23, 2009 at 13:46 UTC ( #752594=note: print w/ replies, xml ) Need Help??


in reply to Re: Reflections on the design of a pure-Moose web app...
in thread Reflections on the design of a pure-Moose web app...

Isn't ORM a method for getting 'persistent Perl objects'?


Comment on Re^2: Reflections on the design of a pure-Moose web app...
Re^3: Reflections on the design of a pure-Moose web app...
by stvn (Monsignor) on Mar 23, 2009 at 20:08 UTC

    No, it is a way to take Objects and a Relational storage of some kind and Map them to one another. The (very well known) impedence mismatch between the O and the R makes truly generalize object persistence difficult.

    -stvn
      And why would one want to do that if not for having persistant objects?
        And why would one want to do that if not for having persistant objects?

        A relational database is just one way to store objects (and a very poor one at that). There is and have been better alternatives out there for many years, so the idea that you should ever have to go through that is just silly. If you choose to, or if your requirements dictate that you do, that is different, but you certainly don't have to use a RDBMS, it is just the most commonly chosen knee-jerk design decision out there.

        Languages like Smalltalk and LISP have had OODBs for a long time now and they are used very successfully in lots of real world mission critical apps. And even Java and .NET have a pretty decent and successful OODB out there as well. And Cocoa nib files are really just archived object graphs that the Cocoa framework unarchives when needed.

        Perl now has KiokuDB, a production-ready alternative to ORMs that does not suffer from impedance mismatch or any of the other annoying compromises that ORMs force you to make.

        My point is really that using a relational database as a dumb object store is neither good OOP or good database-ing. The right tool for the right job, which IMO is exactly what the OP did here.

        -stvn

        A relational database is not an object store. Relational databases don't even exist, instead we have SQL.

        Anyway, a relational database is a data storage system. When writing code that uses said data, you may choose to fetch it and represent it in your program as objects. An ORM may help with this.

        Most ORMs are not object persistence thingies, and they don't expect you to treat the database as opaque blob storage which magically makes objects. At some level, you end up writing something kind of like a SQL query.

        If you truly want to store objects, and not store data in SQL tables, you should probably use an object database like Kioku.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://752594]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-12-21 10:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls