[Koha-devel] Koha and DBIC

Jonathan Druart jonathan.druart at biblibre.com
Mon Sep 15 10:31:13 CEST 2014


2014-09-12 13:47 GMT+02:00 Kyle Hall <kyle.m.hall at gmail.com>:
>> Koha has a lot of complex concepts. Because it offers a lot of modules
>> and possibilities to the users. Koha has to work for every
>> configuration across the world.
>> Biblio won't be a special case. So there are not reason to cut the
>> class in 2 groups: the simple and the complex.
>> All lot will need their own modules, because we need to be flexible and
>> logical.
>
>
> I absolutely agree. I think at the simplest we can use our Result and
> ResultSet classes, at the next level we can extend our Result and ResultSet
> classes, and at the far end of the spectrum we have fancy classes that don't
> map easily to the database but use DBIC objects to get things done.

But we cannot have 2 ways to instantiate an object.
I think we should define how we would like to write code using the "new" API.

For instance:
# Insert a biblio
my $biblio = Koha::Biblio->new($biblio_info)->insert (or create)
# Delete a biblio
my $biblio_2 = Koha::Biblio->fetch($biblionumber)->delete

Does everybody agree we want to write something as easy as it?
If yes, this should work for all objects.
Even if the class if really short (and just tell "this class extends
this one"), it should exist.

I don't think they should be another way for "simple classes".


More information about the Koha-devel mailing list