Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Terminology: Is DBIx::Class an ORM?

by haukex (Archbishop)
on Jun 02, 2021 at 15:27 UTC ( [id://11133429]=note: print w/replies, xml ) Need Help??


in reply to Terminology: Is DBIx::Class an ORM?

I've always thought that since DBIx::Class Maps an Object-oritented data structure to a Relational database, it's an ORM :-) Another way of looking at it, if I want to persist my OO classes to disk, an ORM is one way of doing that. In a quick skim of Object–relational impedance mismatch, it seems to mostly describe issues that would affect code that accesses the same database both via an ORM and without an ORM - that can indeed be a giant pain. But in regards to your question, I'd ask the other way around: why wouldn't DBIx::Class be an ORM?

Replies are listed 'Best First'.
Re^2: Terminology: Is DBIx::Class an ORM?
by haj (Vicar) on Jun 02, 2021 at 17:00 UTC
    I've always thought that since DBIx::Class Maps an Object-oritented data structure to a Relational database, it's an ORM :-)

    Uh-oh... I always found it easy to map an existing relational database to DBIx::Class objects using the DBIx::Class::Schema::Loader and, also often cumbersome to map my object structures to a RDBMS if it wasn't designed for a relational database in the first place.

      often cumbersome to map my object structures to a RDBMS if it wasn't designed for a relational database in the first place

      Yes, I probably should have been more clear on this: The optimal situation is of course desinging both the DB and the OO system at the same time. If one or the other already exist, it can indeed be problematic: When adding an ORM layer to an existing database, the issue is often that not all code accessing the database is going to be replaced at once, so for example a common situation is someone deciding to implement some validation logic in the OO system, which is bypassed by all the other legacy code going directly to the DB - some will argue that the logic belongs in the DB instead, others will argue that the legacy code will get replaced anyway. On the other hand, I can imagine the situation you mention (having an existing OO API that now needs to be mapped to a DB) might be tricky as well, though I personally haven't been in this situation so I'm having trouble imagining how it might occur - perhaps if the objects were previously serialized in some other way...

Re^2: Terminology: Is DBIx::Class an ORM?
by LanX (Saint) on Jun 02, 2021 at 15:29 UTC
      Are you an active user of DBIx::Class ?

      Not at the moment, but I have used it in the past, along with another ORM framework in Java (maybe two, it was a while ago).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (9)
As of 2024-04-19 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found