|
POJOs in Action Developing Enterprise Applications with Lightweight Frameworks Chris Richardson January, 2006 | 592 pages ISBN: 1932394583 |
|||
![]() |
$44.95 | Softbound print book | |
![]() |
$22.50 | PDF ebook | |
Preface
Back in 1999, I enthusiastically embraced J2EE and started developing applications with servlets, JSP pages, and EJBs. Even though I was an uncritical fan of those frameworks, I found that I could simplify development by using what came to be known as "Plain Old Java Objects" (POJOs). For example, in the presentation tier I wrote servlets that delegated to POJOs. And in the business tier I wrote session beans that delegated to POJOs and entity beans that extended POJOs. Using POJOs enabled me to test my code without having to wait for it to be deployed in the server. Because POJOs were not directly supported by the servlet and EJB frameworks, however, I had to jump through a few hoops to use them.
Ironically, it wasn't until after writing an article describing some of those hoops that I started to use lightweight frameworks which support POJOs directly. A couple of reader comments were along the lines of "Why bother with entity beans - why not use an object/relational mapping framework instead? It's a lot simpler." Another reader suggested using Hibernate and another suggested JDO, which were two technologies that I was only vaguely aware of. After experimenting with them for a couple of weeks, I realized that they made persisting objects a lot easier. I found I could develop and test most of the business logic outside of the server. I was hooked!
Hibernate and JDO replaced entity beans, but what to do about those pesky session beans? They need to be deployed in a server, which slows down development. The solution came in the form of the Spring framework. I'd read a few articles about Spring, but its significance did not sink in until I went to TheServerSide.comís Java Symposium (TSSJS) 2004. For the three days I was there, I was indoctrinated in the joys of dependency injection, Spring, and aspect-oriented programming (AOP). I realized that I could replace the session beans with Spring-managed POJOs. I started using Spring right away and immediately found that I could do most development without going near a server. And if a server was required, I could mostly use lightweight servers such as a Jetty. The impact on development was remarkable.
Somewhere along the way, I decided to write this book to share what I had learned. My goal is to teach other developers simpler and faster ways to write enterprise Java applications. I also want to contribute to the Java community from whom I had learned a lot by reading all of those books, articles, and blogs. Originally, this book was going to cover EJBs, JDO, and Hibernate. I had planned to write about how to use POJOs and EJBs together. But when I discovered that a pure POJO and lightweight framework design was a much better approach for many enterprise Java applications, I decided to write a book that focused on POJOs.
Writing this book has been an "interesting" experience, to put it mildly. It has occupied all of my spare time for so long that I've worn out my desk chair and occasionally I'm surprised that I have three children instead of two. (When did that happen?) Along the way I've learned a lot. I've been challenged to think hard about what works and what doesn't. I hope that in this book you will find simpler and faster ways to develop your enterprise Java applications.
DESCRIPTION
“A good way to quickly get up to speed with today’s practices for lightweight development.”
—Floyd Marinescu, Founder, InfoQ.com Creator, TheServerSide.com
“Brings back simplicity to enterprise Java applications.”
—Jonas Bonér, Senior Software Achitect, Terracotta, Inc.
“A valuable guide for lightweight development.”
—Craig Walls, Author, Spring in Action
“The author definitely knows what he is talking about.”
—Oliver Zeigermann, J2EE Architect and Apache committer
“Extremely valuable, plenty of sample code... I enthusiastically recommend it!”
—Brendan Murray, Senior Software Achitect, IBM
There is agreement in the Java community that EJBs often introduce more problems than they solve. Now there is a major trend toward lightweight technologies such as Hibernate, Spring, JDO, iBATIS, and others, all of which allow the developer to work directly with the simpler Plain Old Java Objects, or POJOs. Bowing to the new consensus, EJB 3 now also works with POJOs.
POJOs in Action describes these new, simpler, and faster ways to develop enterprise Java applications. It shows you how to go about making key design decisions, including how to organize and encapsulate the domain logic, access the database, manage transactions, and handle database concurrency.
Written for developers and designers, this is a new-generation Java applications guide. It helps you build lightweight applications that are easier to build, test, and maintain. The book is uniquely practical with design alternatives illustrated through numerous code examples.
What’s Inside
- Leverage the frameworks’ strengths, avoid their weaknesses
- Apply enterprise patterns in the lightweight world
- New patterns like POJO Façade and Exposed Domain Model
- Build rich domain models
- How Aspects improve design
- Lightweight testing strategies
- How to be agile
ABOUT THE AUTHOR...
Chris Richardson is a developer and architect with over 20 years of experience. His consulting company specializes in jumpstarting projects and mentoring teams. Chris has been a technical leader at Insignia, BEA, and elswhere. He has a computer science degree from the University of Cambridge in England and lives in Oakland, CA.


