Viewing By Entry / Main
January 14, 2008
Brian Kotek has released his Transfer decorator bean injector observer which I'm very excited about because I just needed this functionality for a client's project and had to write a version myself. Brian's is more sophisticated and, hopefully, will be integrated into ColdSpring in due course. Now I can use his version instead of mine and know that I'm using a community-supported resource.

I know Brian Ghidinelli also ran into this issue and had started to write his own as well. I expect he'll switch to Brian Kotek's version now.

So what does it do? Well, as you build complex domain objects by writing decorators for Transfer objects, you find you need access to services that you are managing with ColdSpring. Transfer provides an event model so you can add a listener (observer) for the afterNew event and use that to inject dependencies into your domain objects. It's a fairly manual process. What Brian's CFC does is completely automate the process. You declare the injector in your ColdSpring file and pass in Transfer to its constructor. When ColdSpring initializes the injector, the injector registers itself as an observer for that event and then it automatically injects any matching services, based on setters in the decorator. Very slick!

Comments

There are no comments for this entry.

Post Your Comments
Name:
Email Address:
Comments
*** Please note that all comments require moderation so it may be some time before your comment posts to this blog! ***
Remember My Information:
 



Hosting provided by