| Web
News |
Brazil's Telemar eyes Brasil Telecom takeover Brazilian telecommunications group Telemar Participacoes (TNLP4.SA: Quote, Profile, Research)(TNE.N: Quote, Profile, Research) said on Wednesday it had hired financial advisers to study potential...
Largest Retailer in Brazil Selects SAP for Greater Demonstrating ongoing leadership in providing innovative solutions to retailers worldwide, SAP AG (NYSE: SAP) today announced that Grupo Pao de Acucar, the largest retailer in Brazil selling food and general...
The World's Top Social Networking Sites Google's Orkut. Where it's top: Brazil and India make up more than 80 percent of Orkut's traffic. Languages: English, German, Spanish, Italian, Portuguese, Dutch, Russian, Japanese, Korean, Chinese, Marathi...
|
|
01.14.08
Coldfusion: TransferDecorator Bean Injector
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.
| New Server Offer! Double or Triple - You Pick The Winning Savings Combo - Click here today! |
|
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 Senior Computer Scientist and Team Lead in the
Hosted Services group at Adobe Systems Incorporated. He has worked in
the IT industry for nearly twenty-five years, first in database
systems and compilers (serving eight years on the ANSI C++ Standards
Committee), then in mobile telecoms, and finally in web development.
Sean is a staunch advocate of software standards and best practices,
and is a well-known and respected speaker on these subjects. Sean has
championed and contributed to a number of ColdFusion frameworks, and
is a frequent publisher on his blog, http://corfield.org/
|