Hi Jeff,

Many years ago i built an app on CF5, The approach i took was simple, set
request.siteid in Application.cfm and then pass it into whatever methods
needed it. It worked fine but wasn't very elegant.

If i was to do this now, i'd take a different approach.  I'd still have a
set of services where the methods require the siteid as an argument maybe
optionally, this gives you flexibility to query across multiple sites, maybe
in an admin context.
To determine my siteid i'd create an SiteIdentifier.cfc to contain the logic
and which exposed a getSiteIDForCurrentRequest() method. This would be a
ColdSpring managed singleton.  Then i'd create a wrapper class that gets
passed an instance of a service and SiteIdentifier, probably using
onMissingMethod to dynamically call methods on the wrapped service, adding
in the siteID to arguments where needed.

If you don't like onMissingMethod then you could create a set of cfc's which
extend your base services with stub methods and calls to super.doWhatever().

I've just made this up as i'm typing, never tried it so there might be a
large gotcha somewhere :)  But hope its food for thought.

Chris




On 20 January 2011 20:38, jeff <[email protected]> wrote:

> Cmon, somebody had to have attempted a similar type of architecture
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<model-glue%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en
>

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" 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/model-glue?hl=en

Reply via email to