Figures xvii Tables xix Foreword
xxi Foreword
to the First Edition xxiii Preface
xxv Acknowledgments
xxxi About the Authors xxxiii About the Annotators xxxv
Chapter 1: Introduction1
1.
1: Qualities of a Well-Designed Framework 3
Chapter 2: Framework Design Fundamentals 9
2.
1: Progressive Frameworks 11
2.
2: Fundamental Principles of Framework Design 14
Chapter 3: Naming Guidelines 37
3.
1: Capitalization Conventions 38
3.
2: General Naming Conventions 46
3.
3: Names of Assemblies and DLLs 54
3.
4: Names of Namespaces 56
3.
5: Names of Classes, Structs, and Interfaces 60
3.
6: Names of Type Members 68
3.
7: Naming Parameters 73
3.
8: Naming Resources 74
Chapter 4: Type Design Guidelines 77
4.
1: Types and Namespaces 79
4.
2: Choosing Between Class and Struct 84
4.
3: Choosing Between Class and Interface 88
4.
4: Abstract Class Design 95
4.
5: Static Class Design 97
4.
6: Interface Design 98
4.
7: Struct Design 101
4.
8: Enum Design 103
4.
9: Nested Types 115
4.
10: Types and Assembly Metadata 118
Chapter 5: Member Design 121
5.
1: General Member Design Guidelines 121
5.
2: Property Design 138
5.
3: Constructor Design 144
5.
4: Event Design 153
5.
5: Field Design 159
5.
6: Extension Methods 162
5.
7: Operator Overloads 168
5.
8: Parameter Design 175
Chapter 6: Designing for Extensibility 193
6.
1: Extensibility Mechanisms 193
6.
2: Base Classes 206
6.
3: Sealing 207
Chapter 7: Exceptions 211
7.
1: Exception Throwing 216
7.
2: Choosing the Right Type of Exception to Throw 221
7.
3: Using Standard Exception Types 234
7.
4: Designing Custom Exceptions 239
7.
5: Exceptions and Performance 240
Chapter 8: Usage Guidelines 245
8.
1: Arrays 245
8.
2: Attributes 247
8.
3: Collections 250
8.
4: DateTime and DateTimeOffset 261
8.
5: ICloneable 263
8.
6: IComparable and IEquatable 264
8.
7: IDisposable 266
8.
8: Nullable 266
8.
9: Object 268
8.
10: Serialization 274
8.
11: Uri 283
8.
12: System. Xml Usage 284
8.
13: Equality Operators 286
Chapter 9: Common Design Patterns 289
9.
1: Aggregate Components 289