This morning I’m live blogging from TheServerSide Java Symposium 2011 at the breakout “Anti-Patterns and Best Practices for Hibernate” presented by Patrycja Wegrzynowicz.
Making Good Software
Patrycja’s primary goal is to “understand what makes good software good and bad software bad” and she is working to formalize these concepts. She would like to develop automated code tools that can detect ahead of time whether or not code contains anti-patterns and potential performance issues.
For those not familiar with the concept, an anti-pattern is an obvious or common strategy which leads to degraded or counter-intuitive performance.
Is Java Fat
Patrycja asks the question “Is Java fat/slow?”. She claims the language is not, in fact, slow, but that some of the ways in which we program objects is slow, which I agree with strongly. For example, I have seen computational entensive code that improved in memory/speed by large degrees by relying on primitive variables, rather than more complex objects, in part because “new” is considered expensive in Java.
Automated Code Analysis
Requires large knowledge base. Patrycja has been researching semantic code query system which focusses on behavior, not just structure.
Patrycja says that proper usage of hibernate is tricky. Transactional issues and correctness of code under various scenarios. Best solution may be combination of Hibernate and JDBC.
I liked that fact that she stepped back and indicate Hibernate, by itself, isn’t perfect. I agree with her take that the best systems are often hybrid systems that take advantage of the ‘low hanging fruit’ of both worlds, and avoid the pitfalls of each.