DBIC discussion overview
From Koha Wiki
DBIx::Class discussion overview
The discussion has been launched on the [mailing list].
This page will try to list and summarize the different points of view.
Context: Currently, we have 2 package directories: C4 (legacy) and Koha (the new one, should be OO only). We need to define what is the most adapted to migrate all the current code from C4 to Koha.
The Koha community needs to reach a consensus on the following questions.
1 - Where should we put the code logic?
- take full advantage of DIBC
- less complicated
- more consistent
- represent "things", not tables (1+ tables for 1 class).
- scripts don't need to know or care how the data is stored (eg serialised objects in cache, redis etc)
2 - Should we allow find and searches in pl files?
- easier to code
- fixes provided faster
- could be unit tested
- easier to maintain
- easier to reuse
3 - How should we manage ResultSet?
I dont understand this question, the Koha:: modules will deal with the db (or cache) and if using the DB will deal with the ResultSet
a) into Koha::Schema::ResultSet::*
b) into Koha::*::Set
4 - Does Koha::* class should extend Koha::Schema::Result::*
- No, it should use it, where it needs to. To deal with the db, but some Koha objects don't need to touch the db directly.
5 - Does Koha::* class should extend Class::Accessor?
- already used into Koha
6 - Have a common class Koha::Object and Koha::Object::Set
- reuse some common stuffs
- poor design
- why create heavy objects when we just need light ones?
- why layer a db abstraction over a db abstraction?