Right. This is what I was getting at. So its common for people to create a "Controller.cfc" to handle the execution and flow?
Common, no, although some folks do it that way. You're better off using small building blocks and wiring it together using the XML file.
A filter is the best fit for modifying flow control (since it gets passed the event context as well as the current event; and it can also abort the current event handler by returning false).
<event-handler event="myEvent" access="public">
<notify listener="ContactManager" method="getContact" resultKey="request.contact" />
<notify listener="TemplateManager" method="getGetTemplate" resultKey="request.template" />
<announce event="{dynamicevent}" />
</event-handler>
So, for this snippet, how would you use the two result keys (request.contact,request,template) in a conditional statement to determine what event to announce in the ANNOUNCE element. Would you pass the two result keys to a third CFC that would use their values to determine what event to announce and use the announceEvent() function?
Yes. Use <event-arg> to move the two request variables into the event object and then use a filter to process them and announce the appropriate event.
You could then end the handler with <announce event="noEventConfigured"/> and have the filter abort the event handler if it figures out an event to announce (and letting control flow through to the error handler otherwise).
BTW, I'd suggest keeping Mach II discussions on [EMAIL PROTECTED] and leave this (CFCDev) list for broader CFC topics... I don't know that everyone here on CFCDev wants to read about Mach II stuff?
Sean A Corfield -- http://www.corfield.org/blog/
"I have always wished that my computer would be as easy to use as my telephone. My wish has come true - I no longer know how to use my telephone."
-- Bjarne Stroustrup
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
