I’ve got a background in Hibernate and ORM. A little book I penned, named Hiberante Made Easy, was surprisingly a best seller, and before I got knee deep into TheServerSide, I managed to squeak out a living doing the occasional consulting gig where I was put in charge of designing how the service tier communicated with the data tier. Sadly, more often than not, that meant managing and maintaining a system of so many DAOs that you felt like you were DOA as soon as you opened up the code.
Java EE, JPA and the way the various entity managers work has reduced the need for many projects to go whole hog in terms of creating DAOs to service every table in their ERD, but like any technology, there is always a time and a place where its use just makes sense. But doing what makes sense doesn’t necessarily make doing it easy, especially when it comes to the Data Access Object pattern. That’s why Freezer got my attention when Victor Manuel Cerdeira Lopez pitched it to me. “Freezer is a code generator that constructs the persistence layer of a Java application, including DAOs, DTOs, database tables and database documentation,” according to the article Lopez wrote for TSS.
I’d still like to see DAOs go the way of the dodo bird, but that’s not likely going to happen. And if that’s not happening for you, do yourself a favor and check out Freezer. It just might save you a great deal of time and frustration.
Follow Cameron McKenzie on Twitter: @potemcam