[Koha-devel] Data Persistence and Plack

Colin Campbell colin.campbell at ptfs-europe.com
Fri Dec 17 15:30:59 CET 2010


On 17/12/10 11:34, LAURENT Henri-Damien wrote:

> It seems that most of the Circular references in the code are owed to
> functions which have been created to do some checking before doing an
> operation...
> For instance :
> 	CanItemBeRenewed
> 	CanItemBeReserved
> 	CanBookBeReserved
> 	CanItemBeIssued
> 	CanItemBeIssued
> 	....
> 	Deletion of Serials in DelBiblio
> 
Most of those routines are far too large and unmaintainable, many read
the same data repeatedly and all mix business logic and reading data. It
would probably be good if the "things" they deal with were abstracted
into proper objects that police their own destruction, it would also
give you the chance to have a more guaranteed interface to e.g. Item so
that we dont have to scatter validations about through the business
logic. Its one of the attractions of an ORM that it does this for you
but you don't need an ORM to do it. I think if you can abstract away
some of the current complexity it gets easier keep things clean.

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