<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>Referring to the dev meeting and bug 22407, I propose the following rewording:</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span>
<div>PERL15 Using Koha::Object[s]<br>
</div>
<div>PERL15(a) Code added to the Koha:: namespace should be object-oriented unless there is a very good reason to do otherwise. In that case the reason should be documented clearly.<br>
</div>
<div>PERL15(b) Code in Koha::Object[s] should normally not refer back to C4. Obviously, this cannot be enforced harshly until the refactoring has been completed.<br>
</div>
<div>PERL15(c) Use DBIC relations to (pre)fetch a related Koha object rather than searching it explicitly. (See bug 22407)<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>PERL28 Other object oriented code guidelines (in addition to PERL15)</div>
<div>I think we need to move the Accessor and idiom for -> new rules from PERL15 to another rule. I opened rule 28 for that depending on discussing the following:<br>
</div>
<div>Class::Accessor is a great way to provide access to member variables.<br>
</div>
<div>=> My suggestion would be to remove this rule. It is true but we do not say that it is the only way to do it. (We are not even using Class::Accessor in Koha objects.)<br>
</div>
<div>Or just say PERL28(a) To provide access to member variables, there are several ways including but not limited to using Class::Accessor.<br>
</div>
<div><br>
</div>
<div>A useful idiom for the ->new() routine in object-oriented classes that do not need to process the arguments passed in as a hashref but merely need to save them for future processing<br>
</div>
<div>=> This suggestion is fine. It says use a parameter hash for sub new. We normally do that. Reworded:<br>
</div>
<div>PERL 28(b) Use a hashref as second parameter in sub new when passing arguments.<br>
</div>
<span></span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Any feedback?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Marcel</div>
<div style="mso-line-height-rule:exactly;-webkit-text-size-adjust:100%;"><table cellpadding="0" cellspacing="0" border="0" style="width:100%;"><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;"><tr style="font-size:12px;color:#000001;font-style:normal;font-weight:400;white-space:nowrap;"><td align="left" style="vertical-align:top;font-family:Verdana;"> <span style="font-family:remialcxesans;font-size:1px;color:#FFFFFF;line-height:1px;">​</span><br /></td></tr><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;line-height:normal;"><tr style="font-size:0;"><td align="left" style="padding:7px 0 0;vertical-align:top;"><a href="http://www.rijksmuseum.nl/" target="_blank" id="LPlnk689713" style="text-decoration:none;"><img src="cid:image826795.png@ED5367B7.886BCBD5" width="185" height="23" border="0" title="http://www.rijksmuseum.nl" alt="http://www.rijksmuseum.nl" style="width:185px;min-width:185px;max-width:185px;height:23px;min-height:23px;max-height:23px;font-size:12px;" /></a></td></tr></table></td></tr><tr style="font-size:0;"><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="white-space:normal;color:#000001;font-size:14.67px;font-family:Verdana;font-weight:700;font-style:normal;text-align:left;line-height:20px;"><tr style="font-size:12px;"><td style="font-family:Verdana;"><br />​Museumstraat 1<br />Postbus 74888<br />1070 DN Amsterdam<br /><a href="http://www.rijksmuseum.nl/" target="_blank" id="LPlnk689713" title="http://www.rijksmuseum.nl" style="text-decoration:none;color:#000001;"><strong style="font-weight:700;">Rijksmuseum.nl</strong></a><br />​<br />​<span style="font-style:italic;">Nu te zien:<br /></span><span style="text-decoration:underline;"><a href="https://www.rijksmuseum.nl/nl/nachtwacht" target="_blank" id="LPlnk689713" title="Operatie Nachtwacht" style="text-decoration:underline;color:#000001;"><strong style="font-weight:700;">Operatie Nachtwacht​</strong></a></span><br />​<br />​<span style="font-style:italic;">Verwacht:</span> <br /><span style="text-decoration:underline;">​<a href="https://www.rijksmuseum.nl/nl/caravaggio-bernini" target="_blank" id="LPlnk689713" title="Caravaggio-Bernini" style="text-decoration:none;color:#000001;"><strong style="font-weight:700;">Caravaggio-Bernini. Barok in Rome</strong></a></span><br /><a href="https://www.rijksmuseum.nl/nl/nu-in-het-museum/tentoonstellingen-verwacht/dankzij-waller-2010-2020" target="_blank" id="LPlnk689713" title="Dankzij Waller" style="text-decoration:none;color:#000001;"><strong style="font-weight:700;"><span style="text-decoration:underline;">​Dankzij Waller 2010-2020</span></strong></a> <br />​<br />​T/m 18 jaar gratis<br />  <br /> <span style="color:#00B050;">Please think before you print</span><br /></td></tr></table></td></tr></table></td></tr></table></div></body>
</html>