On Wed, Jul 2, 2008 at 5:40 AM, Brian Kotek <[EMAIL PROTECTED]> wrote:
> For your dynamic rendering, it sounds like you probably want to create
> multiple renderer components for a given domain object and then allow the
> domain objects to render themselves using whichever version of the renderer
> that was passed into it.
Given the nature of Marc's problem I might attack the DB table
structure / DAO issue the same way, based on components that
dynamically respond to the DSN being used (which is how I understood
Marc's system to be keyed?).
The DAO would check whether it had an overridden version and defer to
that. I'd probably do it through onMissingMethod().
<cfset var result = 0 />
<cfset var dsn = arguments.missingMethodArguments[1] /> <!--- assuming
DSN is always the first argument --->
<cfif structKeyExists(variables.specialDAOs,dsn)>
<cfinvoke component="#variables.specialDAOs[dsn]#"
method="#arguments.missingMethodName#"
argumentCollection="#arguments.missingMethodArguments#"
returnvariable="result"/>
<cfelse>
<cfinvoke component="#variables.defaultDAO#"
method="#arguments.missingMethodName#"
argumentCollection="#arguments.missingMethodArguments#"
returnvariable="result"/>
</cfif>
<cfif isDefined("result")>
<cfreturn result/>
</cfif>
The defaultDAO and specialDAOs would be injected by ColdSpring (the
specialDAOs could be a MapFactory of dsn / DAO pairs).
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---