On Jun 28, 2011, at 2:59 PM, Nicolás Sabena wrote:

> Thanks for your response, Craig.
> If I understand correctly, the auto-open concern is an issue when the
> same channel is shared on different threads. This is only the case
> when you don’t need the proxy to keep specific context (such as
> security credential) on each call.
> I know the TypedFactoryFacility would be a solution for this,
> resolving the component at the exact moment it's needed, at the cost
> of making the code perhaps more complicated.
> But I don't know what you mean with Lazy<IService1>. I'm guessing it's
> not the lazy component registration capabilities. I searched around
> and found nothing.
> Can you elaborate a little on this?
> 

The trunk (and I believe latest release) of Windsor utilizes an 
ILazyComponentLoaded that will recognize
DotNet 4.0 Lazy<T> dependencies.  What this means is if you change the 
arguments to your ctor to be

public Controller(Lazy<IService>1 service1, Lazy<IService2> service2)
{
}

Then it should be injected with lazy versions of those services which have not 
been resolved from the container
yet and thus have not had channels created.  When you access service1.Value the 
first time, the actual
resolution will occur and channel created.  The TypedFactoryFacility offers the 
same lazy semantics, but achieves
its slightly differently through Funcs.  In the later case, the ctor would look 
like

public Controller(Func<IService>1 service1, Func<IService2> service2)
{
}

and you would access it as service1() as opposed to service1.Value.

Hope this helps

cheers,
  craig


> On Jun 28, 9:03 am, Craig Neuwirt <[email protected]> wrote:
>> For some reason WCF penalizes you heavily if you let it perform auto-open.  
>> In fact, everything becomes sequential and throughput drops dramatically.  
>> Can you inject Lazy<IService1>, Lazy<IService2> to help mitigate your 
>> concern.  You can probably also use the TypedFactoryFacility and inject 
>> Func<IService1>, Func<IService2> as well.
>> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Castle Project Development List" 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-devel?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" 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-devel?hl=en.

Reply via email to