I handle conditional logic and use the Mach-II framework in a slightly different manner. I make a concerted effort to limit the number of listeners and events registered, by only including events specific type of events i.e. events generated by the user (form submission) or by the application (error generation).
Otherwise much of the controller function is included in an Manager Object which acts as a "gatekeeper and traffic controller".
An added bonus is that for future enhancements, you can leave the machii.xml file alone (using it only for input output functions).
Right. This is what I was getting at. So its common for people to create a "Controller.cfc" to handle the execution and flow?
Take this mach-ii sample event snippet:
<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?
While this seems simple, it obfuscates the logic and event from the mach-ii.xml file.
Any thoughts?
---------------------------------- Alex Sherwood PHS Collection Agency THE COLLECTORS T: 301.215.4200 F: 301.664.6834 W: www.phs-net.com
----------------------------------------------------------
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]
