[Koha-devel] [RFC ver2 4/4] DBIx::Class - Changes to C4::Members to start using DBIx::Class

Rick Welykochy rick at praxis.com.au
Wed Nov 12 05:24:39 CET 2008


Ryan Higgins wrote:

> I am guessing that this reveals a lack of fk defs in our base schema in 
> this module.
> While this may seem like a real pain, and seem to raise the bar, so to 
> speak, in terms
> of the amount of effort required to adopt an ORM, I think that investing 
> the time now
> in firming up and fixing Koha's base schema will be well worth it in 
> the  long term.

Definitely agree 100% with that. Excellent idea.


> In short, I'm highly in favor of pursuing this, with the caveat that we 
> have a bit of
> cleanup to do in the process.  An interesting line of thought is whether 
> one might
> approach this 'cleanup' (i.e. properly defining pks, fks & table 
> relations) from the POV
> of the db schema itself, or from the POV of the db abstraction layer.  
> Obviously, it's harder
> to do it from the abstraction layer for an extant schema, but it can be 
> approached from
> either direction.

The database itself should be cleaned up. One reason for this is it is
always best to define as much of the data model in the database itself so
that the DB server can report back any errors it encounters when your
try to update records or delete them.

Another good reason is speed: it is far more efficient and quicker for
the database to get things right than to leave data and relationship
integrity to be checked in the application.

When time permits, I want to take my "tutorial" approach and write a
simple example or two using existing Koha data.

I think we will want to put a thin abstraction layer on top of the somewhat
clunky DBIx::Class interface to make it easier and more foolproof to
handle data model objects in the Koha application. After all, many
eyes, now and in the future, will be reading and maintaining Koha code.

We are after people efficiency, not machine efficiency. The clearer and
more concise the interface to the Koha data model, the better we have done
our job.

That said, I believe that the RFC relating to this should contain an
analysis and design section that clearly lays out how we are going to
use DBIx::Class (since there will be more than one way to do it) and perhaps
document our "thin abstraction" layer if that is agreed to be the way to go.

Oh .. where are these RFCs and how may I contribute?

cheers
rickw


-- 
________________________________________________________________
Rick Welykochy || Praxis Services || Internet Driving Instructor

When the power of love overcomes the love of power,
the world will know peace.
      -- Jimi Hendrix



More information about the Koha-devel mailing list