
------=_Part_6882949_1833668210.1401021211136 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi All, Recently I reviewed a patch that adds a new business entity to the engine. The entity class has the following members: * id * data center id * name * type * some other properties that do not belong to the entity key The equals & hashCode methods were implemented in a way that include all members. I asked the patch author to change that, so it'll include only business key (data center id, name and type), which define the entity uniqueness. Also I found that many other business entities are implemented in a similar way (include all class members in equals & hashCode). I'm a new to oVirt, so I'd like to ask your opinion on the issue. 1. Do you agree with my approach on equals & hashCode. 2. If you agree with my approach in general, should we implement it in the new introduced code or should we adhere to the old convention even we do not agree with it? 3. Should we re-factor the old code (it might be dangerous as we do have enough unit test coverage)? Thanks in advance, Yevgeny ------=_Part_6882949_1833668210.1401021211136 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <html><body><div style=3D"font-family: times new roman, new york, times, se= rif; font-size: 12pt; color: #000000"><div>Hi All,<br></div><div><br></div>= <div>Recently I reviewed a patch that adds a new business entity to the eng= ine.<br>The entity class has the following members:<br><ul><li>id</li><li>d= ata center id</li><li>name<br></li><li>type</li><li>some other properties t= hat do not belong to the entity key</li></ul>The equals & hashCode meth= ods were implemented in a way that include all members.<br></div><div>I ask= ed the patch author to change that, so it'll include only business key (dat= a center id, name and type), which define the entity uniqueness.<br></div><= div>Also I found that many other business entities are implemented in a sim= ilar way (include all class members in equals & hashCode).<br></div><di= v><br></div><div>I'm a new to oVirt, so I'd like to ask your opinion on the= issue. </div><div><ol><li>Do you agree with my approach on equals & ha= shCode.</li><li>If you agree with my approach in general, should we impleme= nt it in the new introduced code or should we adhere to the old convention = even we do not agree with it?<br></li><li>Should we re-factor the old code = (it might be dangerous as we do have enough unit test coverage)?<br></li></= ol><br></div><div>Thanks in advance,<br></div><div>Yevgeny<br></div></div><= /body></html> ------=_Part_6882949_1833668210.1401021211136--