Make the dependency explicitly optional in your code, if it really is optional instead of hacking the contianer.

It'll work better long term


On 26/07/2010 9:17 AM, Ayende Rahien wrote:
ISubDependencyResolver

On Mon, Jul 26, 2010 at 12:51 AM, Adam Langley <[email protected] <mailto:[email protected]>> wrote:

    Can someone tell me, is it possible to configure the Castle
    MicroKernel
    to simply return null for a known service type that doesnt have an
    implementation registered?
    The reason I ask is because I have a scenario where a specific service
    will NOT be available, but client code will still attempt to
    locate it,
    and handle the return being null. All these ComponentNotFound
    exceptions
    are slowing the program down.

    I was hoping for something like

    Kernel.Register(Component.For<IMyServiceContract>().Unavailable())

    Any possibilities?

    - Adam Langley

    --
    You received this message because you are subscribed to the Google
    Groups "Castle Project Users" group.
    To post to this group, send email to
    [email protected]
    <mailto:[email protected]>.
    To unsubscribe from this group, send email to
    [email protected]
    <mailto:castle-project-users%[email protected]>.
    For more options, visit this group at
    http://groups.google.com/group/castle-project-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Castle Project Users" 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/castle-project-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Castle 
Project Users" 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/castle-project-users?hl=en.

Reply via email to