On 24/12/19 13:41, Dmitriy Brashevets wrote:
>
> Hi Dev Team.
>
>  
>
> In Syncope 2_0_X branch all models that extend the 
> /org.apache.syncope.common.lib.AbstractBaseBean /previously used
>
> /org.apache.commons.lang3.builder.EqualsBuilder#reflectionEquals() 
> /and/org.apache.commons.lang3.builder.HashCodeBuilder#reflectionHashCode() / 
> in the contract of Object#equals and Object#hashCode methods.
>
>  
>
> Starting from 2_1_X the equals and hashCode contract has changed and is 
> declared explicitly in each model.
>
>  
>
> I see that it was removed to fix the performance: 
> https://issues.apache.org/jira/browse/SYNCOPE-1392 
> <https://issues.apache.org/jira/browse/SYNCOPE-1392>.
>
> Do you have any charts or diagrams that can demonstrate how the performance 
> was improved?
>
>  
>
> We widely use the *syncope-client-lib* in our code and models from this 
> library. And I’m afraid of that we can potentially have issues in our app, 
> because the contract has changed.
>
Hi Dmitriy,
you can find a whole set of articles / comments / questions / commits on the 
Internet about performance troubles with reflection-based builders from Apache 
Commons Lang.

Still, we don't have any comparison for the specific change of removing such 
builders in favor to their non-reflective counterparts.

If your code is just  depending on syncope-client-lib, then no changes are 
expected on your side, as all required methods were changed upstream.

If your code is instead extending classes from syncope-client-lib, then you'll 
have to provide equals() / hashcode() (and possibly toString() as well) methods 
to your classes, according to the parent-child pattern as shown by [1][2], for 
example.

Hope this clarifies.
Regards.

[1] 
https://github.com/apache/syncope/blob/2_1_X/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java#L124-L133
[2] 
https://github.com/apache/syncope/blob/2_1_X/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java#L147-L155

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/

Reply via email to