http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14694 --- Comment #25 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #22)
(In reply to Kyle M Hall from comment #20)
::: Koha/Biblio.pm @@ +41,5 @@
+or list of Koha::Item objects in list context. + +=cut + +sub items {
Wouldn't be better to use a DBIx::Class relation? Something like bug 14819.
No, we want to return a Koha::Object object, not a DBIC object. It would be most confusing if a Koha::Object method were to return a DBIC object instead of a Koha Object.
And what about using the _wrap method? I am afraid that we are going to introduce quickly circular dependencies in the Koha namespace if we follow this way.
The _wrap method would still require including Koha::Items, so that does not solve anything. In addition, you are assuming circular dependencies are always a bad thing. It is important to realize our objects are loosely coupled, rather than tightly coupled. Because of this, we could re-engineer Koha::Items to be anything we want inside, it's a black box. Koha::Biblio doesn't care how Koha::Items works, nor should it. In fact, using the _wrap method makes the objects more tightly coupled, as we are now accessing private methods and tying the objects together with a specific implementation. If we *really* want to decouple all of our objects, we need to build a factory to create all our objects whether they are Koha::Object(s) based or not. -- You are receiving this mail because: You are watching all bug changes.