Friday, August 10, 2007

More on rethinking JEE 5 patterns

Adam Bien often discusses the rethinking of JEE 5 patterns and best practices in his blog, and his latest entry discusses a replacement for the Value List Handler pattern that was prevalent in the J2EE 1.4 and earlier worlds called the Paginator. While I can't say I love the name, the implementation is interesting -- it's really not much different than the old VLH pattern, except that it returns detached JPA Entities instead of Value Objects (hence the reason for the rename)...

What is interesting is that he has implemented the Iterator interface for this implementation, and each call to 'next()' returns a full page of JPA Entities... the code is really quite simple, and I'm sure it could benefit from further use of generics to make this a reusable Stateful Session Bean, but the fact that he is implementing an interface that every Java developer knows and uses pretty much every day (well, before JSE 5 came around, anyway), can only help people realize that perhaps now we can move closer to a real object oriented design... That is definitely a Good Thing... I urge people to take a look at the code in his Subversion repository (and some of the others in there are worth a look, too!)

M