Available:*
Library | Item Barcode | Call Number | Material Type | Item Category 1 | Status |
---|---|---|---|---|---|
Searching... | 30000003605536 | QA76.625 R54 2003 | Open Access Book | Book | Searching... |
On Order
Summary
Summary
The Microsoft .NET Framework provides powerful technologies such as ASP.NET Web Forms, XML Web services, and Windows Forms to simplify developing applications and components that work seamlessly on the Internet. This book shows how to make the most of the .NET Framework's common language runtime (CLR). Written by two highly respected developer/writers and intended for anyone who understands OOP concepts such as data abstraction, inheritance, and polymorphism, this book clearly explains the extensible type system of the CLR, examines how the CLR manages the behavior of types, and explores how an application manipulates types. While focusing on Visual Basic .NET, its in-depth explanations and concepts apply equally to all programming languages that target the .NET Framework.
Topics covered include:
The .NET Framework architecture Building, packaging, deploying, and administering applications and their types Building and deploying shared assemblies Type fundamentals Primitive, reference, and value types Operations common to all objects Type members and accessibility Constants, fields, methods, properties, and events Working with text Enumerated types and bit flags Array types Interfaces Custom attributes Delegates Error handling with exceptions Automatic memory management AppDomains and reflectionAuthor Notes
Jeffrey Richter is a cofounder of Wintellect
Francesco Balena, a trainer and consultant for Wintellect
Table of Contents
Acknowledgments | p. xvii |
Introduction | p. xix |
Part I Basics of the Microsoft .NET Framework | |
1 The Architecture of the .NET Framework Development Platform | p. 3 |
Compiling Source Code into Managed Modules | p. 3 |
Combining Managed Modules into Assemblies | p. 8 |
Loading the Common Language Runtime | p. 9 |
Executing Your Assembly's Code | p. 12 |
IL and Verification | p. 20 |
The .NET Framework Class Library | p. 22 |
The Common Type System | p. 26 |
The Common Language Specification | p. 28 |
Interoperability with Unmanaged Code | p. 33 |
2 Building, Packaging, Deploying, and Administering Applications and Types | p. 37 |
.NET Framework Deployment Goals | p. 38 |
Building Types into a Module | p. 39 |
Combining Modules to Form an Assembly | p. 48 |
Adding Assemblies to a Project Using the Visual Studio .NET IDE | p. 56 |
Using the Assembly Linker | p. 57 |
Including Resource Files in the Assembly | p. 59 |
Assembly Version Resource Information | p. 59 |
Version Numbers | p. 63 |
Culture | p. 65 |
Simple Application Deployment (Privately Deployed Assemblies) | p. 66 |
Simple Administrative Control (Configuration) | p. 68 |
3 Shared Assemblies | p. 73 |
Two Kinds of Assemblies, Two Kinds of Deployment | p. 74 |
Giving an Assembly a Strong Name | p. 75 |
The Global Assembly Cache | p. 82 |
The Internal Structure of the GAC | p. 88 |
Building an Assembly That References a Strongly Named Assembly | p. 90 |
Strongly Named Assemblies Are Tamper-Resistant | p. 92 |
Delayed Signing | p. 93 |
Privately Deploying Strongly Named Assemblies | p. 97 |
Side-by-Side Execution | p. 100 |
How the Runtime Resolves Type References | p. 101 |
Advanced Administrative Control (Configuration) | p. 104 |
Publisher Policy Control | p. 110 |
Repairing a Faulty Application | p. 113 |
Part II Working with Types and the Common Language Runtime | |
4 Type Fundamentals | p. 119 |
All Types Are Derived from System. Object | p. 119 |
Visual Basic Standard Modules | p. 121 |
Casting Between Types | p. 126 |
Casting with the CType Operator | p. 129 |
Testing an Object's Type with the TypeOf ... Is Expression | p. 131 |
Namespaces and Assemblies | p. 133 |
5 Primitive, Reference, and Value Types | p. 139 |
Programming Language Primitive Types | p. 139 |
Checked and Unchecked Primitive Type Operations | p. 144 |
Reference Types and Value Types | p. 146 |
Boxing and Unboxing Value Types | p. 153 |
6 Common Object Operations | p. 165 |
Object Equality and Identity | p. 165 |
Implementing Equals for a Reference Type Whose Base Classes Don't Override Object's Equals | p. 166 |
Implementing Equals for a Reference Type When One or More of Its Base Classes Overrides Object's Equals | p. 168 |
Implementing Equals for a Value Type | p. 169 |
Summary of Implementing Equals and the Equality and Inequality Operators | p. 172 |
Identity | p. 172 |
Object Hash Codes | p. 173 |
Object Cloning | p. 176 |
Part III Designing Types | |
7 Type Members and Their Accessibility | p. 181 |
Type Members | p. 181 |
Accessibility Modifiers and Predefined Attributes | p. 185 |
Type Predefined Attributes | p. 187 |
Field Predefined Attributes | p. 187 |
Method Predefined Attributes | p. 188 |
8 Constants and Fields | p. 191 |
Constants | p. 191 |
When Is a Constant Not Always a Constant? | p. 192 |
Fields | p. 194 |
9 Methods | p. 197 |
Instance Constructors | p. 197 |
Type Constructors | p. 204 |
Passing Parameters by Reference to a Method | p. 208 |
Passing a Variable Number of Parameters to a Method | p. 211 |
Optional Arguments | p. 214 |
Static Variables in a Method | p. 217 |
Operator Overload Methods | p. 220 |
Operators and Programming Language Interoperability | p. 222 |
Conversion Operator Methods | p. 226 |
How Virtual Methods Are Called | p. 227 |
Virtual Method Versioning | p. 228 |
10 Properties | p. 235 |
Parameterless Properties | p. 235 |
Parameterful Properties | p. 240 |
11 Events | p. 245 |
Designing a Type That Exposes an Event | p. 246 |
Designing a Type That Listens for an Event | p. 252 |
A Simpler Way to Register and Unregister Interest in Events | p. 255 |
Part IV Essential Types | |
12 Working with Text | p. 261 |
Characters | p. 261 |
The System. String Type | p. 265 |
Constructing Strings | p. 265 |
Strings Are Immutable | p. 268 |
Comparing Strings | p. 269 |
String Interning | p. 274 |
String Pooling | p. 278 |
Examining a String's Characters | p. 279 |
Other String Operations | p. 282 |
Dynamically Constructing a String Efficiently | p. 282 |
Constructing a StringBuilder Object | p. 283 |
StringBuilder's Members | p. 284 |
Obtaining a String Representation for an Object | p. 287 |
Specific Formats and Cultures | p. 288 |
Formatting Multiple Objects into a Single String | p. 292 |
Providing Your Own Custom Formatter | p. 294 |
Parsing a String to Obtain an Object | p. 297 |
Encodings: Converting Between Characters and Bytes | p. 301 |
Encoding/Decoding Streams of Characters and Bytes | p. 309 |
Base-64 String Encoding and Decoding | p. 310 |
13 Enumerated Types and Bit Flags | p. 313 |
Enumerated Types | p. 313 |
Bit Flags | p. 319 |
14 Arrays | p. 323 |
All Arrays Are Implicitly Derived from System.Array | p. 327 |
Casting Arrays | p. 329 |
Passing and Returning Arrays | p. 331 |
Creating Arrays That Have a Nonzero Lower Bound | p. 332 |
Fast Array Access | p. 334 |
Redimensioning an Array | p. 338 |
15 Interfaces | p. 343 |
Interfaces and Inheritance | p. 343 |
Designing an Application That Supports Plug-In Components | p. 350 |
Changing Fields in a Boxed Value Type Using Interfaces | p. 351 |
Implementing Multiple Interfaces That Have the Same Method Name and Signature | p. 355 |
Improving Type Safety and Reducing Boxing | p. 358 |
16 Custom Attributes | p. 363 |
Using Custom Attributes | p. 363 |
Defining Your Own Attribute | p. 367 |
Attribute Constructor and Field/Property Data Types | p. 371 |
Detecting the Use of a Custom Attribute | p. 372 |
Matching Two Attribute Instances Against Each Other | p. 377 |
Pseudo-Custom Attributes | p. 381 |
17 Delegates | p. 383 |
A First Look at Delegates | p. 383 |
Using Delegates to Call Back Static Methods | p. 386 |
Using Delegates to Call Back Instance Methods | p. 388 |
Demystifying Delegates | p. 389 |
Some Delegate History: System.Delegate and System.MulticastDelegate | p. 394 |
Comparing Delegates for Equality | p. 395 |
Delegate Chains | p. 396 |
Having More Control over Invoking a Delegate Chain | p. 401 |
Delegates and Reflection | p. 404 |
Part V Managing Types | |
18 Exceptions | p. 411 |
The Mechanics of Exception Handling | p. 412 |
The Try Block | p. 414 |
The Catch Block | p. 414 |
The Finally Block | p. 416 |
What Exactly Is an Exception? | p. 417 |
The System.Exception Class | p. 422 |
FCL-Defined Exception Classes | p. 424 |
Defining Your Own Exception Class | p. 427 |
How to Use Exceptions Properly | p. 432 |
You Can't Have Too Many Finally Blocks | p. 432 |
Don't Catch Everything | p. 433 |
Gracefully Recovering from an Exception | p. 435 |
Backing Out of a Partially Completed Operation When an Unrecoverable Exception Occurs | p. 436 |
Hiding an Implementation Detail | p. 437 |
What's Wrong with the FCL | p. 440 |
Performance Considerations | p. 442 |
Catch Filters | p. 445 |
What Happened to the On Error Statement? | p. 449 |
Unhandled Exceptions | p. 450 |
Controlling What the CLR Does When an Unhandled Exception Occurs | p. 456 |
Unhandled Exceptions and Windows Forms | p. 457 |
Unhandled Exceptions and ASP.NET Web Forms | p. 459 |
Unhandled Exceptions and ASP.NET XML Web Services | p. 460 |
Exception Stack Traces | p. 460 |
Remoting Stack Traces | p. 463 |
Debugging Exceptions | p. 464 |
Telling Visual Studio What Kind of Code to Debug | p. 468 |
19 Automatic Memory Management (Garbage Collection) | p. 471 |
Understanding the Basics of Working in a Garbage-Collected Platform | p. 471 |
The Garbage Collection Algorithm | p. 475 |
Finalization | p. 480 |
What Causes Finalize Methods to Get Called | p. 485 |
Finalization Internals | p. 487 |
The Dispose Pattern: Forcing an Object to Clean Up | p. 491 |
Using a Type That Implements the Dispose Pattern | p. 499 |
Accounting for Exceptions When Using the Dispose Pattern | p. 504 |
An Interesting Dependency Issue | p. 505 |
Weak References | p. 506 |
Weak Reference Internals | p. 508 |
Resurrection | p. 510 |
Designing an Object Pool Using Resurrection | p. 512 |
Generations | p. 515 |
Programmatic Control of the Garbage Collector | p. 521 |
Other Garbage Collector Performance Issues | p. 523 |
Synchronization-Free Allocations | p. 525 |
Scalable Parallel Collections | p. 525 |
Concurrent Collections | p. 525 |
Large Objects | p. 527 |
Monitoring Garbage Collections | p. 528 |
20 CLR Hosting, AppDomains, and Reflection | p. 529 |
Metadata: The Cornerstone of the .NET Framework | p. 529 |
CLR Hosting | p. 530 |
AppDomains | p. 532 |
Accessing Objects Across AppDomain Boundaries | p. 536 |
AppDomain Events | p. 537 |
Applications and How They Host the CLR and Manage AppDomains | p. 538 |
"Yukon" | p. 540 |
The Gist of Reflection | p. 540 |
Reflecting Over an Assembly's Types | p. 542 |
Reflecting Over an AppDomain's Assemblies | p. 545 |
Reflecting Over a Type's Members: Binding | p. 546 |
Explicitly Loading Assemblies | p. 547 |
Loading Assemblies as "Data Files" | p. 550 |
Building a Hierarchy of Exception-Derived Types | p. 551 |
Explicitly Unloading Assemblies: Unloading an AppDomain | p. 554 |
Obtaining a Reference to a System.Type Object | p. 556 |
Reflecting Over a Type's Members | p. 560 |
Creating an Instance of a Type | p. 563 |
Calling a Type's Method | p. 565 |
Bind Once, Invoke Multiple Times | p. 570 |
Reflecting Over a Type's Interfaces | p. 576 |
Reflection Performance | p. 578 |
Index | p. 581 |