.NET Remoting 使用最佳实践,(部分翻译)

1.          Use only server-activated objects configured as SingleCall
           只使用服务器端激活的SingleCall对象        

2.          Use the HttpChannel with the BinaryFormatter. Host your components in IIS if you need scalability, authentication and authorization features.
            使用HTTP管道下的二进制传输,使用IIS宿主,如果你需要可扩展性(可扩展到群集),认证和授权。

3.          Use IIS' ability to deactivate HTTP KeepAlives for maximum scalability.
     
4.          Use Windows Network Load Balancing in a cluster of servers during development if you want to achieve scalability. Make sure to deactivate any client affinity and make sure that you deactivate http keepalives during development!
         使用windows网络负载均衡来获取可扩展新,确认无客户端耦合...

5.         Do not use client-activated objects and don't pass any MarshalByRefObject over a remoting boundary if you plan on running on a cluster. You will easily trap this if you use the .NET Framework version 1.1 which will throw a SecurityException or a SerializationException in this case. (Yes, you could change this setting -but you shouldn't!)
          不使用客户端激活对象,如果想把系统用于群集,那么不用MarshalByRefObject参数。在.NET 1.1中,你会得到异常.

6.          Do not use events, callbacks and client-side sponsors.
         不使用事件,回调,不用客户端发起的租期管理。

7.          Do not use static fields to hold state for operational data which is subject to being changed by your users. Instead, always put this kind of state information in your database. If you keep volatile state in memory, you will run into problems if you try to scale your application out to a cluster of servers. Cache information only if it's not going to change (like a list of states or cities) - else you will run into cachesynchronization nightmares on your cluster.
         不使用static字段来保存可能被用户修改的状态数据。应该把这些数据放在数据库中。如果内存中有不稳定的状态值,那么你在扩展到聚集的时候会碰到麻烦,只应该缓存不会被改变的数据(比如城市列表),否则在聚集服务的时候,你会碰到缓存同步的问题。

8.          Do not use Remoting for anything else apart from .NET to .NET communications. Use ASP.NET Web Services and the Web Services Enhancements (WSE) for anything related to SOAP, Service Oriented Architectures and platform independence.
         除了.NET和.NET间访问,不使用Remoting, 使用WSE.

9.         Do not try to fit distributed transactions, security, and such into custom channel sinks. Instead, use Enterprise Services if applicable in your environment. .NET Remoting isn't a middleware, it is just a transport protocol - if you need services, use a service-oriented framework. And yes, you can use .NET Remoting to access Enterprise Services’ components as well!
         不要尝试使用Channel sink来管理分布式连接,权限等,使用Enterprise Services来替代。


 

原文地址:https://www.cnblogs.com/billqian/p/490343.html