我们先来看看这书的作者Jeffrey Richter,Jeffrey Richter是一位在全球享有盛誉的技术作家,尤其在Windows/.NET领域有着杰出的贡献。他的第一本Windows著作Windows 3: A Developer's Guide大获好评,从而声名远扬。之后,他又推出了经典著作《Windows 高级编程指南》和《Windows核心编程》。如今这两本书早已成为Windows程序设计领域的颠峰之作,培育了几代软件开发设计人员。他的每一本新作问世,我们都有理由相信这是一本巨著,我们想要的一切尽在其中。Jeffery 是Wintellect公司的创始人之一,也是MSDN杂志.NET专栏的特邀编辑。现在他正领导开发该公司的.NET程序设计课程,向大众推广.NET技术。因为他自1999年开始就参与了微软.NET框架开发组的咨询工作,与这些一线人员一起经历了.NET的孕育与诞生,所以他对.NET思想的领悟、对.NET的细节熟稔,是其他任何作家难以企及的。他是.NET著作领域中当之无愧的一面旗帜。
2003年我买了这本书的第一版《Microsoft .NET框架程序设计(修订版)》,从那时我才真正深入了解.net,后来这本书被朋友借去没还,很让我咬牙切齿了一阵。
2006年我买了这本书的第二版《框架设计(第2版):CLR Via C#》,没完全看完,翻译的虽然不如第一版,但还不算垃圾,英文不太好的可以买本看看,但如果英文过的去也比较有空的话可以看看原版,网上有电子版下载。
前天我在网上看到了这本书的最新版,下载,本来想看完再仔细写个读后感的,但鉴于全书896页,我觉得以我读英文的速度和我空余时间综合计算没3个月拿不下来,别耽误的别人,就先推荐一下吧。
作者:Jeffrey Richter
出版日期:February 2010
出版社:Microsoft Press
页数:896
ISBN:978-0-7356-4045-0
目录:
Part I CLR Basics
1 The CLR’s Execution Model . 1
Compiling Source Code into Managed Modules . 1
Combining Managed Modules into Assemblies 5
Loading the Common Language Runtime 6
Executing Your Assembly’s Code 9
IL and Verification 15
Unsafe Code 16
The Native Code Generator Tool: NGen.exe . 18
The Framework Class Library . 20
The Common Type System 22
The Common Language Specification . 25
Interoperability with Unmanaged Code 29
2 Building, Packaging, Deploying, and Administering Applications
and Types 31
.NET Framework Deployment Goals 32
Building Types into a Module 33
Response Files . 34
A Brief Look at Metadata . 36
Combining Modules to Form an Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
Adding Assemblies to a Project by Using the Visual Studio IDE 49
Using the Assembly Linker 50
Adding Resource Files to an Assembly . 52
Assembly Version Resource Information . 53
Version Numbers 57
Culture . 58
Simple Application Deployment (Privately Deployed Assemblies) . 59
Simple Administrative Control (Configuration) 61
3 Shared Assemblies and Strongly Named Assemblies . 65
Two Kinds of Assemblies, Two Kinds of Deployment 66
Giving an Assembly a Strong Name . 67
The Global Assembly Cache 73
Building an Assembly That References a Strongly Named Assembly 75
Strongly Named Assemblies Are Tamper-Resistant 76
Delayed Signing . 77
Privately Deploying Strongly Named Assemblies 80
How the Runtime Resolves Type References 81
Advanced Administrative Control (Configuration) 84
Publisher Policy Control 87
Part II Designing Types
4 Type Fundamentals 91
All Types Are Derived from System.Object . 91
Casting Between Types . 93
Casting with the C# is and as Operators . 95
Namespaces and Assemblies . 97
How Things Relate at Runtime 102
5 Primitive, Reference, and Value Types . 113
Programming Language Primitive Types 113
Checked and Unchecked Primitive Type Operations . 117
Reference Types and Value Types . 121
Boxing and Unboxing Value Types . 127
Changing Fields in a Boxed Value Type by Using Interfaces (and Why You
Shouldn’t Do This) . 140
Object Equality and Identity 143
Object Hash Codes 146
The dynamic Primitive Type 148
6 Type and Member Basics . 155
The Different Kinds of Type Members . 155
Type Visibility 158
Friend Assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .159
Member Accessibility 160
Static Classes . 162
Partial Classes, Structures, and Interfaces . 164
Components, Polymorphism, and Versioning 165
How the CLR Calls Virtual Methods, Properties, and Events 167
Using Type Visibility and Member Accessibility Intelligently . 172
Dealing with Virtual Methods When Versioning Types . . . . . . . . . . . . . . . . . . . . .175
7 Constants and Fields 181
Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181
Fields 183
8 Methods . 187
Instance Constructors and Classes (Reference Types) . 187
Instance Constructors and Structures (Value Types) . 191
Type Constructors 194
Type Constructor Performance 198
Operator Overload Methods . 200
Operators and Programming Language Interoperability . 203
Conversion Operator Methods 204
Extension Methods 207
Rules and Guidelines 210
Extending Various Types with Extension Methods 211
The Extension Attribute 213
Partial Methods 213
Rules and Guidelines 216
9 Parameters . 219
Optional and Named Parameters . 219
Rules and Guidelines 220
The DefaultParameterValue and Optional Attributes 222
Implicitly Typed Local Variables 223
Passing Parameters by Reference to a Method 225
Passing a Variable Number of Arguments to a Method . 231
Parameter and Return Type Guidelines . 233
Const-ness 235
10 Properties 237
Parameterless Properties 237
Automatically Implemented Properties . 241
Defining Properties Intelligently 242
Object and Collection Initializers 245
Anonymous Types 247
The System.Tuple Type 250
Parameterful Properties . 252
The Performance of Calling Property Accessor Methods 257
Property Accessor Accessibility . 258
Generic Property Accessor Methods 258
11 Events . 259
Designing a Type That Exposes an Event 260
Step #1: Define a type that will hold any additional information
that should be sent to receivers of the event notification 261
Step #2: Define the event member . 262
Step #3: Define a method responsible for raising the event to
notify registered objects that the event has occurred . 263
Step #4: Define a method that translates the input into the desired event 266
How the Compiler Implements an Event . 266
Designing a Type That Listens for an Event 269
Explicitly Implementing an Event 271
12 Generics . 275
Generics in the Framework Class Library . 280
Wintellect’s Power Collections Library . 281
Generics Infrastructure . 282
Open and Closed Types 283
Generic Types and Inheritance 285
Generic Type Identity 287
Code Explosion . 288
Generic Interfaces 289
Generic Delegates 290
Delegate and Interface Contravariant and Covariant Generic Type Arguments 291
Generic Methods . 293
Generic Methods and Type Inference 294
Generics and Other Members . 296
Verifiability and Constraints . 296
Primary Constraints 299
Secondary Constraints . 300
Constructor Constraints 301
Other Verifiability Issues . 302
13 Interfaces . 307
Class and Interface Inheritance . 308
Defining an Interface 308
Inheriting an Interface 310
More About Calling Interface Methods . 312
Implicit and Explicit Interface Method Implementations (What’s Happening
Behind the Scenes) . 314
Generic Interfaces 315
Generics and Interface Constraints 318
Implementing Multiple Interfaces That Have the Same Method Name
and Signature 319
Improving Compile-Time Type Safety with Explicit Interface Method
Implementations 320
Be Careful with Explicit Interface Method Implementations . 322
Design: Base Class or Interface? 325
Part III Essential Types
14 Chars, Strings, and Working with Text 327
Characters . 327
The System.String Type . 330
Constructing Strings 330
Strings Are Immutable . 333
Comparing Strings . 334
String Interning . 340
String Pooling . 343
Examining a String’s Characters and Text Elements . 343
Other String Operations 346
Constructing a String Efficiently 346
Constructing a StringBuilder Object 347
StringBuilder Members 348
Obtaining a String Representation of an Object: ToString 350
Specific Formats and Cultures 351
Formatting Multiple Objects into a Single String . 355
Providing Your Own Custom Formatter . 356
Parsing a String to Obtain an Object: Parse . 359
Encodings: Converting Between Characters and Bytes 361
Encoding and Decoding Streams of Characters and Bytes 367
Base-64 String Encoding and Decoding 368
Secure Strings . 369
15 Enumerated Types and Bit Flags 373
Enumerated Types . 373
Bit Flags . 379
Adding Methods to Enumerated Types . 383
16 Arrays 385
Initializing Array Elements 388
Casting Arrays 390
All Arrays Are Implicitly Derived from System.Array . 392
All Arrays Implicitly Implement IEnumerable,