Comments on Hibernate in Action
Hibernate in Action by Christian Bauer and Gavin King is probably the best book of its type. I mean the type of book that teaches a popular development tool (other books in this category includes those on JUnit, XDoclet and Ant etc..).
It is best because of several reasons. (1) Object/Relational Mapping is one of the fundamental problems every developer in this era (when object-oriented language and relational database are the corner stones of almost all enterprise systems) needs to have a minimal understanding. It deserves a serious exploration in computing literature. (2) It has a fine balance in discussing the general concerns in ORM and introducing the specific solution in Hibernate. The first aspect provides the necessary depth that similar books usually lacks. (3) The authors obviously have a clear understanding of developers’ mentality, therefore are able to articulate the topics in a logically cohesive manner that is certainly very accessible to developers.
I particularly like the discussion on the relationships among application transaction, system transaction, session and variables in ThreadLocal scope. Those relationships are critically important for enterprise developers, and never related to the real–life technical professional better elsewhere. For example, in JMS specification, relationships among Thread, Session and Transaction are not well defined. In JSP and Servlet specifications, variable scopes such as Application, HttpSession, Request and Page are deservedly emphasized, but transaction issues, particularly concurrency, puzzle a lot of beginners.
Another interesting discussion is on “Dirty Check Strategy” in the appendix. Interception has a lot of use cases, therefore the similar strategies have been used in quite several other spaces such as AOP etc.. I had a similar requirement in synchronizing objects with persistent XML in a configuration framework. The lack of interception in Java has pushed Chain of Interceptor pattern to a prominent status in J2EE development community. It will be interesting to write an article comparing all those strategies and comments on their pros and cons in various use cases.


0 Comments:
Post a Comment
<< Home