0

I'm working with an application that uses WSTrustChannelFactory to create trust channels, I noticed that the code is creating a new WSTrustChannelFactory everytime a new channel is needed.

I've never worked with this before but since this is a factory I suppose it can be implemented as a singleton.

Am I right? If so, is there any additional consideration to take (will the factory always be "usable" or there are any scenarios/exceptions where it should be replaced with a new instance)?. Also, is the factory creation an expensive operation, such as a WCF ChannelFactory creation?

4

1 回答 1

1

我对吗?

是的,我认为你是。我参与过几个我们使用 a 的项目,channel factory而且每次都是singleton. 它当然有其局限性,并且在非常高的负载下可能成为瓶颈,但对于很多实现我认为你很好。

于 2013-05-09T15:56:28.027 回答