[Koha-devel] Restructuring C4

Robin Sheat robin at catalyst.net.nz
Wed Apr 6 06:11:40 CEST 2011


Galen Charlton schreef op wo 30-03-2011 om 20:51 [-0700]:
> 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. 

I approve of this idea, and am starting it with my accounts rewrite.

I'll create a Koha/Accounts.pm and am in the process of pulling all the
direct database access to the accounts tables out of other modules and
putting the required functionality into the accounts module. 

Additionally, do we want to split things up within the Koha namespace,
for example database-accessing code vs. the more business logicy stuff?
My personal inclination is to not do that, and it wouldn't be a terrible
refactoring to do at a later stage if it were required.

Oh, something else that's recommended that I tend to do is not export
anything by default, requiring the module to be included like:
 use C4::Accounts qw/ get_users_balance /;
mostly this prevents surprising things getting into your namespace. This
is more a style suggestion though.

-- 
Robin Sheat
Catalyst IT Ltd.
✆ +64 4 803 2204
GPG: 5957 6D23 8B16 EFAB FEF8  7175 14D3 6485 A99C EB6D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: </pipermail/koha-devel/attachments/20110406/8181642e/attachment.pgp>


More information about the Koha-devel mailing list