Java Reference
In-Depth Information
Sometimes you must use a technology for a while in order to appreciate its true
value. A few years ago I had to go out of the country on a business trip, and I
didn't want to risk missing episodes of my favorite show. So, rather than continu-
ing to struggle with the timer function on my VCR , I bought a TiVo box. At the
time I thought it was simply going to be a much more convenient and reliable way
to record programs. The TiVo box certainly made it easy to record a show, but
before long it completely changed how I watched television. In addition to being
able to pause live TV , I was able to watch my favorite shows when I wanted and
without commercials.
I had a similar experience with plain old Java objects ( POJO s), Hibernate, and
Spring. I was part of a team developing a server product that had a “classic” Enter-
prise JavaBeans ( EJB ) architecture: the business logic consisted of session beans
and entity beans. EJB definitely helped by handling infrastructure issues such as
transaction management, security, and persistence—but at a high price. For
example, we endured long edit-compile-debug cycles caused by having to deploy
the components in the application server. We also jumped through all kinds of
hoops in order to implement a domain model with entity beans. But somehow we
accepted all of this pain as normal.
The final straw was when we were faced with having to support the product on
two application servers. Rather than endure the lack of portability of EJB container-
managed persistence ( CMP ) we decided to be adventurous and use a portable per-
sistence mechanism that I was hearing a lot about: Hibernate. Hibernate worked
the same way on both application servers and eliminated the need to maintain two
separate but equivalent sets of EJB CMP deployment descriptors. But before long we
discovered other, much more important benefits of Hibernate. It enabled us to
implement a more elaborate POJO domain model in the next version of the prod-
uct. It sped development by allowing the domain model to be tested without an
application server or a database. And soon after we discovered the Spring frame-
work, which enabled us to create a more loosely coupled architecture consisting of
easy-to-test POJO services. In hindsight, it's amazing that we accomplished as much
as we did with the old architecture.
POJO s in Action describes how POJO s and lightweight technologies such as
Spring, Hibernate, and Java Data Objects ( JDO ) make it easier and faster to
develop testable and maintainable applications. You will learn how object-
oriented design goes hand in hand with POJO s and how to endow POJO s with the
characteristics that enterprise applications require, such as transactions and per-
sistence. It describes how to use Spring for transaction management and Hiber-
nate, JDO , EJB 3 , and i BATIS for persistence.
 
Search WWH ::




Custom Search