Welcome

首页 / 软件开发 / .NET编程技术 / 改进.NET应用程序的性能和可伸缩性(二)

改进.NET应用程序的性能和可伸缩性(二)2011-12-17 博客园 蛙蛙池塘为性能和可伸缩性做架构和设计上的Review

部署和体系结构

Use distributed architectures appropriately. Do not introduce distribution unnecessarily.

适当的使用分布式架构,不要在不必要的时候使用分布式(译注:这个不好把握,主要靠经验,或者 讲一些具体例子大家更容易明白)。

Carefully select appropriate distributed communication mechanisms.

仔细小心的选择适当的分布式通信机制(译注:综合考虑性能,安全,兼容性等来选择用socket开发 协议,还是用现成的wcf,remoting,web service,web api等)。

Locate components that interact frequently within the same boundary or as close to each other as possible.

频繁交互的组件应在相同的边界内或者尽可能的接近。(译注:翻译的有些拗口,不明白具体意思, 风行说可能就是就近原则)。

Take infrastructure restrictions into account in your design.

在设计中,把基础架构的限制考虑在内。(译注:比较抽象,不懂)。

Consider network bandwidth restrictions.

考虑网络带宽的限制。

Identify resource restrictions.

明确资源的限制。

Ensure your design does not prevent you from scaling up.

确保你的设计不会阻止你的横向扩容(scaling up)。

Ensure your design does not prevent you from scaling out and it uses logical layers, does not unwittingly introduce affinity, and supports load balancing.

确保你的设计不会阻止你的纵向扩容(scaling out),并且他使用业务逻辑层,不无意中引入近亲( 译注:翻译可能不对,不懂啥意思),并且支持负载均衡。(译注:不同的应用可能会有不同的负载策略 ,源IP负载,还是按流量负载,还是7层负载,适用于不同的场合。)

耦合性和内聚性

Ensure your design is loosely coupled.

确保你的设计是松散耦合。

Exhibit appropriate degrees of cohesion in your design and group together logically related entities, such as classes and methods.

在你的设计里显示出适当的内聚性,组合逻辑相关的实体,如类和方法(译注: group together不知 道咋翻译)。

Restrict use of late binding and only use late binding where it is necessary and appropriate.

避免使用晚期绑定,并且只在必要和适当的时候使用晚期绑定(译注:晚期绑定只在vb,asp等语言才 有吧,这个不是说用就能用的吧,晚期绑定是一种运行时的行为,所以可能会损耗应用的运行性能)。