成员设计准则Member Design Guidelines

方法、属性、事件、构造函数和字段统称为成员。Methods, properties, events, constructors, and fields are collectively referred to as members. 成员最终是指向框架的最终用户公开框架功能的方式。Members are ultimately the means by which framework functionality is exposed to the end users of a framework.

成员可以为虚拟或非虚拟、具体或抽象、静态或实例,并可具有多个不同的可访问性范围。Members can be virtual or nonvirtual, concrete or abstract, static or instance, and can have several different scopes of accessibility. 所有这些组件都提供令人难以置信的表现力,但同时需要注意框架设计器的一部分。All this variety provides incredible expressiveness but at the same time requires care on the part of the framework designer.

本章提供设计任何类型的成员时应遵循的基本准则。This chapter offers basic guidelines that should be followed when designing members of any type.

本节内容In This Section

成员重载Member Overloading
属性设计Property Design
构造函数设计Constructor Design
事件设计Event Design
现场设计Field Design
扩展方法Extension Methods
运算符重载Operator Overloads
参数设计Parameter Design
部分©2005,2009 Microsoft Corporation。保留所有权利。Portions © 2005, 2009 Microsoft Corporation. All rights reserved.

皮尔逊教育,Inc. 的经许可重印权限:从框架设计指导原则:用于可重复使用的 .Net 库的约定、惯例和模式、第2版By Krzysztof Cwalina 和 Brad Abrams,发布十月22,2008,作为 Microsoft Windows 开发系列的一部分。Reprinted by permission of Pearson Education, Inc. from Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries, 2nd Edition by Krzysztof Cwalina and Brad Abrams, published Oct 22, 2008 by Addison-Wesley Professional as part of the Microsoft Windows Development Series.

另请参阅See also