суббота, 18 августа 2012 г.

О многопоточности, "бегстве ссылок" и final

  • http://www.slideshare.net/alexmiller/java-concurrency-gotchas-3666977
  • http://www.ibm.com/developerworks/java/library/j-jtp0618/index.html#code4
  • http://www.javamex.com/tutorials/synchronization_final.shtml
  • http://renaud.waldura.com/doc/java/final-keyword.shtml
  • http://madpropellerhead.com/random/20100328-java-final-fields-are-not-as-final-as-you-may-think
  • http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#finalWrong
  • http://www.rsdn.ru/forum/java/3622844.all.aspx
  • http://www.ibm.com/developerworks/ru/library/j-jtp06294/index.html
  • http://stackoverflow.com/questions/3705425/java-reference-escape

вторник, 14 августа 2012 г.

equals and hashCode

Казалось бы, что тут все просто и тема давно изведана, но остается вопрос о instaceof vs getClass ... подборка материала:
А еще больше вопросов возникает при реализации указанных методов в сущностях:
"Never use the database identifier to implement equality. Instead, use a business key that is a combination of unique, typically immutable, attributes. The database identifier changes if a transient object is made persistent. If the transient instance, together with detached instances, is held in a Set, changing the hash-code breaks the contract of the Set. Attributes for business keys can be less stable than database primary keys. You only need to guarantee stability as long as the objects are in the same Set." (Hibernate ref)