[Koha-devel] Restructuring C4

Colin Campbell colin.campbell at ptfs-europe.com
Wed Apr 6 16:29:02 CEST 2011


On 06/04/11 13:30, Galen Charlton wrote:
> Hi,
> 
> On Wed, Apr 6, 2011 at 12:11 AM, Robin Sheat <robin at catalyst.net.nz> wrote:
>> 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.
> 
> I'd prefer a separation between business logic and data access,
> actually.  Perhaps
> 
> # data access - though the choice of naming may better follow whatever
> pattern DBIx::Class imposes:

If anyone wants to experiment with DBIx::Class  using
DBIx::Class::Schema::Loader gives you a
quick way to start:
from the kohaclone directory you use the command
dbicdump -o dump_directory=. Koha::Schema dbi:mysql:dbname=koha
kohaadminuser password
This writes a Koha::Schema class and a Koha::Schema::Results::X class
for every table in the database and you can regenerate it the same way
to reflect db changes (but it preserves any custom code you add)

Colin


-- 
Colin Campbell
Chief Software Engineer,
PTFS Europe Limited
Content Management and Library Solutions
+44 (0) 845 557 5634 (phone)
+44 (0) 7759 633626  (mobile)
colin.campbell at ptfs-europe.com
skype: colin_campbell2

http://www.ptfs-europe.com


More information about the Koha-devel mailing list