So basically it goes down like this:

In the controller.cfc, in the init() function, we create all of our
CFC objects and pass in a unique siteID when instantianting them.

ie: variables.servicesCFC = createobject(….).init(dsn, siteID)

Then, inside the services.cfc file, all the functions have an
additional filter that checks the siteID, so getAll() would looke like

SELECT * from services
WHERE siteID = #variables.siteID#

All the functions have similar filters, which basically sandboxes the
user to their own data


On Jun 24, 5:17 pm, Baz <[email protected]> wrote:
> I don't think that duplicating all the cfc's nor passing the SiteID into
> every function call are the optimal solutions. Can you give a bit more
> detail on your setup, with some examples of functions that you would pass
> the SiteID into.
>
> For example, as an extremely simplified model, could we say that you have
> sub1.jeff.com and sub2.jeff.com, which are identical sites except that their
> titles are different? Then to get their titles you would want to do
> getTitle() but to make sure you get the right one you are thinking of doing
> getTitle('sub1') and getTitle('sub2'). If that's the case, then you're
> screwed - just kidding, but is that kind'of what you're talking about?
>
> Baz
>
> On Wed, Jun 24, 2009 at 4:15 PM, jeff <[email protected]> wrote:
>
> > I have to make an application where multiple domains (or subdomains)
> > should be using the same code base.  Previously, the way I did this
> > was create a new model glue “application” instance for each unique
> > domain.
>
> > Then in the init() method of controller.cfc, we would
> > 1)      Get the unique siteID out of the database based on the domain name
> > 2)      Instantiate all of the CFCs to the variables scope by passing in
> > the unique siteID
>
> > Looking back, this seems kind of wasteful, and it seems like it would
> > be easier to somehow save the siteID to session or something and pass
> > then into EVERY function call instead of creating duplicate cfcs.
> > Anyone have any recommendations for how to go about this best?  Will
> > this make programming it way more complex?
--~--~---------~--~----~------------~-------~--~----~
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

For more about Model-Glue, check http://www.model-glue.com .
-~----------~----~----~----~------~----~------~--~---

Reply via email to