<div dir="ltr">Yes. I'm imagining something along the lines of Koha::Object, and Koha::Object::Set which would have all the boilerplate we need for general use ( get, set, find, search, etc ). Then all our table-tied objects would inherit from Koha::Object and a set of those objects would inherit from Koha::Object::Set. Both of those classes can be DBIC-aware internally.<div><br></div><div>Internally Koha::Object would have a DBIC Result as a property, which can be used independently from the database ( which would be good for unit testing ). Each Koha::Object::Set would normally keep only a ResultSet internally and work on that until asked to return a Koha::Object, at which point it would wrap each Result in a Koha::Object and store them internally, or return an array of them depending on what type of return value the method was called with.</div><div><br></div><div>I would be willing to write up Koha::Object and Koha::Object::Set if this is what Robin, Tomas et. al. are looking for.</div><div><br></div><div>In this way we have DBIC totally encapsulated so the code using Koha::Object and Koha::Object::Set's is totally DBIC unaware but internally is DBIC aware.</div><div><br></div><div>In addition, if we have these two classes to inherit from, it will reduce the amount of code we must write, and make it much easier for new developers. One we have Object and Object::Set written, we don't have to rewrite our CRUD boilerplate for each and every new class we add.</div><div><br></div><div>What do you think?</div><div><br></div><div>Kyle</div></div><div class="gmail_extra"><br clear="all"><div><a href="http://www.kylehall.info" target="_blank">http://www.kylehall.info</a><br>ByWater Solutions ( <a href="http://bywatersolutions.com" target="_blank">http://bywatersolutions.com</a> )<br>Meadville Public Library ( <a href="http://www.meadvillelibrary.org" target="_blank">http://www.meadvillelibrary.org</a> )<br>Crawford County Federated Library System ( <a href="http://www.ccfls.org" target="_blank">http://www.ccfls.org</a> )<br>Mill Run Technology Solutions ( <a href="http://millruntech.com" target="_blank">http://millruntech.com</a> )<br></div>
<br><div class="gmail_quote">On Mon, Sep 15, 2014 at 3:11 PM, Marcel de Rooy <span dir="ltr"><<a href="mailto:M.de.Rooy@rijksmuseum.nl" target="_blank">M.de.Rooy@rijksmuseum.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><span class="">> I am troubled by the idea that we should wrap all our dbic classes in yet more classes. Every example I've seen of this has more code by a factor of almost 10. I don't know if
 Koha is so complex that it requires a repository pattern.
</span><div style="font-family:Times New Roman;color:#000000;font-size:16px">
<div>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div>I think that it would require rewriting Koha. This changeover might just be too complex for us.<br>
<br>
</div><span class="">
> How much more difficult will this be for developers, and how much more overhead will it require if we wrap our objects in more objects? We'd have to fetch the Row objects, wrap them in KohaRow objects, wrap those in a KohaRowSet, and return them. Certainly,
 but far more complicated.
</span><div>I would say: Leave all storage related actions in Koha::Schema. KohaRow does not make sense to me.<br>
Furthermore, define the objects that actually have 'real' business logic and put that in some Koha::Object.<span class="HOEnZb"><font color="#888888"><br>
<br>
Marcel<br>
</font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

<br>_______________________________________________<br>
Koha-devel mailing list<br>
<a href="mailto:Koha-devel@lists.koha-community.org">Koha-devel@lists.koha-community.org</a><br>
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
website : <a href="http://www.koha-community.org/" target="_blank">http://www.koha-community.org/</a><br>
git : <a href="http://git.koha-community.org/" target="_blank">http://git.koha-community.org/</a><br>
bugs : <a href="http://bugs.koha-community.org/" target="_blank">http://bugs.koha-community.org/</a><br></blockquote></div><br></div>