Luis Majano Forums Notification: Post to cfscript enhancement

Title: RE: cfscript enhancement
Thread: cfscript enhancement
Forum: Enhancements
Conference: ColdBox
User: lmajano

Hi Sana,
well, it is very basic and global. You use the setting: UDFLibraryFile
in your config.xml to point to a UDF file to be mixed in to all your event
handlers. So you can actually add any kind of functionality to your event
handlers, via this mixin. This ability has been there since version 1.1 I
believe. It has not been discussed much, but I guess I will have to do a guide
on it.

I have been thinking of a way to do it on a per handler basis, but
then that means that I will need to do my own dependency injection framework
almost. So I am not sure if I want to do this. This is better left for
coldspring or lightwire. So what I am thinking for in the next release is to
actually have an addition to my plugin/event handlers factories in which it
would use the ioc plugin itself to create the plugins and handlers. This way,
plugins and handlers can be declared in your coldspring/lightwire declarations
and then be created by the ioc plugin and used by ColdBox.

This is just an
interesting idea to explore on, this way, you can use DI on your handlers to do
service compositions, and more. All from withing your coldspring/lightwire
implementations.

I guess I diverted a lot, but yes, using that UDFLibraryFile
setting, you can inject your handlers with whatever you want.

http://www.luismajano.com/forums/index.cfm?event=ehMessages.dspMessages&threadid=F8D42D34-123F-6116-42B870F7CA5901EA