forwarding on this discussion to users@ re: the use (or otherwise) of ObjectContracts.
I've updated its Javadoc and added some content into our new (though not yet published) Asciidocs pages ... https://issues.apache.org/jira/browse/ISIS-1139 Thx Dan On 1 April 2015 at 13:25, Martin Grigorov <[email protected]> wrote: > > On Tue, Mar 31, 2015 at 2:17 PM, GESCONSULTOR - Óscar Bou < > [email protected]> wrote: > >> Really helpful, Martin. >> >> It impacts a lot of operations in our apps, when we use extensively the >> ObjectContracts implementation and there can be quite operations on >> Collections. >> > > One more reason - type safety. > Account#compareTo() until now was comparing by "name". For some time there > is no such property in this class... > > >> >> Perhaps can Dan think about an improvement on its implementation? >> >> We’re using Reflections in many places in Isis. So perhaps some kind of >> global “caching” could be useful ? >> >> Thanks! >> >> >> >> El 31/3/2015, a las 12:08, Martin Grigorov <[email protected]> >> escribió: >> >> Hi, >> >> I am playing with YourKit here and I've checked what is slow ... [snip] >> >> In the attachment you can see two slow operations: >> >> [snip] >> 2) ... usage of ObjectContracts#compare(Object, Object, String) >> This one uses Java reflection to compare the objects without any caching >> of the class meta data. >> >> I've replaced the code with: >> @Override >> public int compareTo(final SomeViewModel other) { >> // Order first by Confidence, then by risk, and finally alphabetically. >> return ComparisonChain.start() >> .compare(getConfidence(), other.getConfidence()) >> .compare(getRisk(), other.getRisk(), Ordering.natural().nullsLast()) >> .compare(getName(), other.getName()) >> .result(); >> } >> >> and now the rendering of the page is a bit faster. >> I'd suggest to deprecate ObjectContracts#compare(Object, Object, String) >> >> >> >> *Óscar Bou Bou* >> Responsable de Producto >> Auditor Jefe de Certificación ISO 27001 en BSI >> CISA, CRISC, APMG ISO 20000, ITIL-F >> >> 902 900 231 / 620 267 520 >> http://www.twitter.com/oscarbou >> >> http://es.linkedin.com/in/oscarbou >> >> http://www.GesConsultor.com <http://www.gesconsultor.com/> >> >> >> >> Este mensaje y los ficheros anexos son confidenciales. Los mismos >> contienen información reservada que no puede ser difundida. Si usted ha >> recibido este correo por error, tenga la amabilidad de eliminarlo de su >> sistema y avisar al remitente mediante reenvío a su dirección electrónica; >> no deberá copiar el mensaje ni divulgar su contenido a ninguna persona. >> Su dirección de correo electrónico junto a sus datos personales constan >> en un fichero titularidad de Gesdatos Software, S.L. cuya finalidad es la >> de mantener el contacto con Ud. Si quiere saber de qué información >> disponemos de Ud., modificarla, y en su caso, cancelarla, puede hacerlo >> enviando un escrito al efecto, acompañado de una fotocopia de su D.N.I. a >> la siguiente dirección: Gesdatos Software, S.L. , Paseo de la Castellana, >> 153 bajo - 28046 (Madrid), y Avda. Cortes Valencianas num. 50, 1ºC - 46015 >> (Valencia). Asimismo, es su responsabilidad comprobar que este mensaje o >> sus archivos adjuntos no contengan virus informáticos, y en caso que los >> tuvieran eliminarlos. >> >> >> >> >> >> >
