Visit the ColdFusionProNews Directory
Beginners
Installation, Coding Techniques, Data Structures...
CF Powered Sites
Stores, Directories, Universities...
Developers
Developers, Designers, Experts...
E-commerce
Shoes, Food, Music...
Education
Books, Online Resource, Languages...
Expert
LiveChat , CFX XMLParser , User Defined Function Library...
Hosting
Dedicated Servers, Virtual Server, Multi-user...
Intermediate
AutoResize , DataSource Encryption, Guestbook...

Submit your site for FREE

Kotek’s Transfer Decorator Bean Injector


Sean Corfield By: Sean Corfield

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

About The Author

Sean is currently Chief Technology Officer for Railo Technologies US. He has worked in IT for over twenty five years, starting out writing database systems and compilers then moving into mobile telecoms and finally into web development in 1997. Along the way, he worked on the ISO and ANSI C++ Standards committees for eight years and is a staunch advocate of software standards and best practice. Sean has championed and contributed to a number of CFML frameworks and was lead developer on Fusebox for two years.

Leave a Reply


















Get Your Site
Submitted for Free
in the World's Largest
B2B Directory!

Email Address:
*URL:
*
*Indicates Mandatory Field
Terms & Conditions