Should WCF service typically be singleton or not?

后端 未结 3 850
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-05 10:29

I believe Jimmy Nillson said he generally made his webservices singletons. Is this the preferred method, and with WCF? Other than making the service methods static, is there

3条回答
  •  心在旅途
    2020-12-05 10:52

    Singleton WCF services should hardly ever be used- Singletons are the enemy of scalability! They only make sense in weird scenarios- logging to a single file, a single communications port or hardware device.

    As Marc says the best choice for scalability with WCF is per call services (they offer the best trade off between performance and scalability). Per call services also work very well with load balancing.

提交回复
热议问题