I, too, am looking forward to the multitenancy integration. As it
stands, I'll probably be trying to get something similar to the above
running in a local environment. Not sure on timelines, but if I get it
up and running, I'll zip it up and send it over.
As for detecting and consuming the appropriate tenant, I agree, it's
up to the consuming app to propagate that around, but I'm thinking
there will probably have to be Resolve<T> overloads that take in a
tenant ID. If no tenant ID is passed in, if the tenant ID is null, or
if the overload without the tenant ID is used, then things behave as
they do today. If a tenant ID is provided, the tenant-specific
dependency will be resolved.
What I'm not sure about yet (at least, how it'd be implemented) is how
tenant specific lifetimes work and persist themselves. Like if you
have a SingleInstance lifetime object, is that SingleInstance *per
tenant* or for the *whole app*? What if one tenant overrides that
registration? I'm thinking there's going to have to be something like
InstancePerTenant() that translates to
InstancePerMatchingLifetimeScope(Tenant) or something, and
SingleInstance will actually mean for the whole app.
The tenant lifetime scope would have to stick around for the duration
of the app, too, so that'll have to be stuck somewhere.
Hmmm. I'll have to think some more about this. It was so much easier
in 1.x. :)
-T
On May 21, 11:03 am, Matt Burton <
matt.bur...@gmail.com> wrote:
> Ugh, started a response 3 days ago and haven't been able to finish.
> Here's the bit I had:
>
> > c) a way of detecting and consuming the current tenant
>
> This is really a function of the hosting application, IMO - you could
> perhaps offer sample code for say WCF services and an
ASP.NET MVC
> application with a suggested method for identifying the tenant for
> each request but it's really an implementation detail that can't be
> made generic, necessarily.
>
> Everything else looks good - hopefully this weekend I might have some
> time to update the issue tracker, if it hasn't been done already.
>
> Thanks,
> Matt
>
> On Tue, May 18, 2010 at 3:07 PM, Nicholas Blumhardt
>
> <
nicholas.blumha...@gmail.com> wrote:
> > Matt, suffering a bit of inbox cloggage here, hope I'm not too late to the
> > party!
> > I like the idea of creating a more integrated API - the concept of using
> > tentant ids is nice and the XML additions would be slick :)
> > On precedence, I think the standard 'last in wins' style will carry over to
> > this implementation. I agree with the defaults you suggested.
> > There seem to be a few different pieces required -
> > a) the underlying container management infrastructure (still probably from
> > one of the options discussed earlier)
> > b) the configuration API (either builder-per-tenant or a module-based
> > system; definitely some XML goodness though)
> > c) a way of detecting and consuming the current tenant
> > The first two items just need a shake out - we could put together some
> > prototypes and see where the rough edges are.
> > I'm still not sure about the third; is there a "typical" technique for
> > pulling this off?
> > When I have some time - or if anyone else wants to jump in - perhaps moving
> > all of this to the issue tracker now is a good idea.
> > Cheers,
> > Nick
> ...
>
> read more »