[Koha-devel] Restructuring C4

Galen Charlton gmcharlt at gmail.com
Thu Mar 31 05:51:45 CEST 2011


Hi,


2011/3/30 Ian Walls <ian.walls at bywatersolutions.com>:
> All this indicate to me that we REALLY need to start thinking about imposing
> some kind of structure on C4.  I'm thinking something with two-levels:
>
> Level 1 :  Calls to the database, other direct interaction with stored data
> Level 2:   Calls to Level 1 functions to manipulate data

Thanks for doing the analysis.  Regarding the overall project of
restructuring C4, I suggest a slightly different way of looking at it:
*not* restructuring C4 as such, but using it as a springboard for its
successor.

In other words, we'd still be creating a better structure, just in a
different namespace.  Let's pick a name randomly for that namespace.
I reach into my hat and pull out ... "Koha".  Fancy that. :)

The Koha namespace would be for Perl modules that meet the following
mandatory conditions:

- usable by mod_perl (or its equivalent)
- export the minimum number of routines necessary
- follow stricture, warnings, documentation, and test case standards
- separating data access methods from business logic

and preferably the following optional conditions:

- purely OO

Obviously, the conditions and whether they would be mandatory or
optional is a topic for discussion.

Modules in C4 could use (and would be encouraged to use) routines in
the Koha namespace.  Modules in Koha could not in general use C4
modules; any C4 module that was safe to be depended on by a Koha
module would be a candidate for being renamed to Koha.

The advantage of carving out a new namespace is that it doesn't
require that we refactor the entirety of C4 to support persistance or
to untangle the dependency tree.  Instead, the only C4 code we would
have to reimplement for the Koha namespace right away would be
authentication, basic session management, and basic output.  That,
along with data access using DBIx::Class, would allow us to start
using mod_perl right away for specific functions.  One example of
something that would then be easy to transform to a service running
under mod_perl would be the unapi and OAI-PMH services.  As
functionality gets detangled from C4 and moved into Koha, we can
increase the number of services running under mod_perl while still
keeping the CGI scripts that still depend on C4.

Regards,

Galen
-- 
Galen Charlton
gmcharlt at gmail.com


More information about the Koha-devel mailing list