I don't understand how a sub dependency resovler helps?
They seem to be used to resolve services that are required as
constructor parameters or injected properties?

I noticed there is a FactoryActivator which could be used with a
dependency resolver to resolve the factories create method arguments.

The resolver could then pass the "version" or what mode we are in to the
Factory to create the correct service.

Is this what you meant?



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
hammett
Sent: Monday, 13 November 2006 12:01 PM
To: castleproject-users@lists.sourceforge.net
Subject: Re: [Castle-users] Starting Out - Design Question

> Using castle in an idealistic way we could set the scope ie the
version,
> then request the action using the type of ISomeAction as a key.

How I would do it:

- Create a facility the "marks" the versionable services, and/or
action implemention as long as they all implement the same interface

- Implement a custom ISubDependencyResolver and register it on the
DependencyResolver. This custom resolver will skip components that are
not marked with versionable/contextualizable flag. It will also use
the contextual information (see next bullet)

- On the HttpHandler grab the token and set the context using the
HttpContext.Current.Items (for example)

- Done

> The system "knows" it is in test mode it would be great if castle
could
> also "know" it was in test mode and provide the test implementation of
> ISomeNotificationSender rather than the "live" implementation.

This is definitely not a container concern. What you could do, as I
mentioned above, is customize how dependencies are resolved and give
hints about what you want, so the resolver can act accordingly.

-- 
Cheers,
hammett
http://hammett.castleproject.org/

------------------------------------------------------------------------
-
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
CastleProject-users mailing list
CastleProject-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/castleproject-users

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
CastleProject-users mailing list
CastleProject-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/castleproject-users

Reply via email to