4

Type Design Guidelines

From the CLR perspective, there are only two categories of types— reference types and value types—but for the purpose of discussing framework design, we divide types into more logical groups, each with its own specific design rules. Figure 4-1 shows these logical groups.

Images

Figure 4-1: The logical grouping of types

Classes are the general case of reference types. They make up the bulk of types in the majority of frameworks. Classes owe their popularity to the rich set of object-oriented features they support and to their general applicability. Base classes and abstract classes are special logical groups related to extensibility. ...

Get Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.