On 9/7/07, Paul Vernon <[EMAIL PROTECTED]> wrote: > > > Essentially, there is a central registry of events that tracks this for > me. > I can query the registry to see what objects had registered event handlers > for any given event if I need to, but 99.9% of the time *i don't need to > know* because it handles it all for me. I call this registry the > "listener" > because it is the object responsible for registering the event handlers, > listening for events and invoking the relevant handlers.
OK, but you're defining the event to listener mappings somewhere then. That's the point. To have somewhere you can look to figure out what is going on. I've seen apps (particularly Flash/Flex apps but it could apply to CF as well) where people just have an event run that calls a method and that method raises another event, meanwhile other objects are listening to those events and they run, and maybe raise yet other events. This almost instantly turns into a spaghetti nightmare where you have absolutely no idea what is going on. By giving the responsibility of registration to the init functions of each > object, I do not need to statically configure dependencies in an XML file > like you are describing for Mach-II. Instead, the entire application > object > hierarchy configures itself dynamically and any dependencies are resolved > automatically. I'm not sure what you mean here. If you mean "object dependencies", I use ColdSpring to resolve dependencies (as well as perform AOP tasks and proxy generation). I'm unclear on how you could resolve all the object dependencies by the "application object hierarchy" since CF only supports single inheritance. Unless you have some other, external method of defining this hierarchy. Also, by using an object factory to handle the object instantiation, I don't > even have to worry about an object being there or not at start up. If an > object isn't there and a piece of code runs that has a dependency, the > object factory handles the instantiation of that "missing" object. Factories are wonderful. Again, I use ColdSpring but rolling your own is always an option. The only static configuration I have to do for my apps is telling it which > features any given app has. Some clients want a newsletter manager, some > want and e-Commerce system. All I do is set up the objectFactory config > file > as required and run the app. > > Because we couple this framework with a separate presentation layer > (usually > XHTML), most of my work these days is based on configuration, styling and > resource bundle editing :-)... It makes for fast development and > turnaround > times with a higher profit margin than building from scratch every time. > Every so often, a client asks for a feature that we don't have so I still > get to build new sets of objects and features in CF. As always, separate presentation layers are a must. What you describe sounds similar to what Peter Bell is doing with his generation of applications based on DSLs (domain-specific languages for anyone who might not know the acronym). I have to say though, I wouldn't attempt to do this sort of thing in PHP > maybe ASP.NET but not PHP... What a hateful situation that would be. CF > makes my life so much easier! Heh, yes CF makes many things very easy. To be fair, you could totally do this in PHP as well. In some ways it's support for objects is better than CF's (static methods can be handy). (And if Vince pops in, yes, I know BlueDragon has static methods ;-) ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288005 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4