October 30, 2002

Beauty of POJOs

Being architecture neutral - I totally agree with James on his points. Back when I was looking at persistence frameworks I came to the conclusion that submitting my domain objects to some sort of persistence manager was the way to go. Two main reasons why, both really stemming from simplicity:

  • Testing: I can test object behavior without dealing with the database. This is crucial.
  • Education: Teaching other people about the pieces of the system is now much easier. There are no Data Transfer Objects -- the object you use on the server in a Session Bean is the same as the object you use in a Servlet.

This also allows me to create the processes as POJOs for testing purposes. So a Session Bean (or any other sort of coordinating component) just has to deal with transaction management and building the process objects. It's so crazy, it just might work!

Next: Open source diversity
Previous: IDEs and editors