Thursday, July 19, 2007

cfcBlaster gets a DIAPER

I made a small update to the cfcBlaster code that has made some of the work I've been doing with unit testing a little easier.

There is a new template called bean.xslt that I put together based on the Streamlined Object Modeling DIAPER ideas. It can only handle the simple properties that you can pull out of your db. You would have to add on any/all object collaboration methods and properties by hand.

There are a few things I like about these objects. The first is that they are really well encapsulated to start with (you can certainly make them less so as you work with them). They are completely ignorant of storage. I've been pushing that functionality into the DAO/Gateway object(s). You can easily instantiate one using the scribble pad in cfeclipse and it will generally work. You don't need any supporting code to get the thing off the ground. The run method is handy because not only does it make getting a sample of the object with reasonable values really easy, it can also be used to help with the mock object issues with some of the unit testing frameworks.

Speaking of cfeclipse, while the resulting cfcs are a little large (bloated?), they do collapse up pretty nicely.

No comments:

Post a Comment