<html><body><div style="font-family: times new roman, new york, times, serif; 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 engine.<br>The entity class has the following members:<br><ul><li>id</li><li>data center id</li><li>name<br></li><li>type</li><li>some other properties that do not belong to the entity key</li></ul>The equals & hashCode methods were implemented in a way that include all members.<br></div><div>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.<br></div><div>Also I found that many other business entities are implemented in a similar way (include all class members in equals & hashCode).<br></div><div><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 & hashCode.</li><li>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?<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>