Tuesday, February 17, 2009

Applied Microsoft .NET Framework Programming

Author: Jeffrey Richter

The Microsoft® .NET Framework allows developers to quickly build robust, secure ASP.NET Web Forms and XML Web service applications, Windows® Forms applications, tools, and types. Find out all about its common language runtime and learn how to leverage its power to build, package, and deploy any kind of application or component. APPLIED MICROSOFT .NET FRAMEWORK PROGRAMMING is ideal for anyone who understands object-oriented programming concepts such as data abstraction, inheritance, and polymorphism. The book carefully explains the extensible type system of the .NET Framework, examines how the runtime manages the behavior of types, and explores how an application manipulates types. While focusing on C#, it presents concepts applicable 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 reflectionIncludes coverage of C#

Table of Contents:

AcknowledgmentsIntroduction

PART I BASICS OF THE MICROSOFT .NET FRAMEWORK1. The Architecture of the .NET Framework Development PlatformCompiling Source Code into Managed ModulesCombining Managed Modules into AssembliesLoading the Common Language RuntimeExecuting Your Assembly's Code IL and VerificationThe .NET Framework Class LibraryThe Common Type SystemThe Common Language SpecificationInteroperability with Unmanaged Code2. Building, Packaging, Deploying, and Administering Applications and Types.NET Framework Deployment GoalsBuilding Types into a ModuleCombining Modules to Form an Assembly Adding Assemblies to a Project Using the Visual Studio .NET IDE Using the Assembly Linker Including Resource Files in the AssemblyAssembly Version Resource Information Version NumbersCultureSimple Application Deployment (Privately Deployed Assemblies)Simple Administrative Control (Configuration)3. Shared AssembliesTwo Kinds of Assemblies, Two Kinds of DeploymentGiving an Assembly a Strong NameThe Global Assembly Cache The Internal Structure of the GACBuilding an Assembly That References a Strongly Named AssemblyStrongly Named Assemblies Are Tamper-ResistantDelayed SigningPrivately Deploying Strongly Named AssembliesSide-by-Side ExecutionHow the Runtime Resolves Type ReferencesAdvanced Administrative Control (Configuration) Publisher Policy ControlRepairing a Faulty Application

PART II WORKING WITH TYPES AND THE COMMON LANGUAGE RUNTIME4. Type FundamentalsAll Types Are Derived from System.ObjectCasting Between Types Casting with the C# is and as OperatorsNamespaces and Assemblies5. Primitive, Reference, and Value TypesProgramming Language Primitive Types Checked and Unchecked Primitive Type OperationsReference Types and Values TypesBoxing and Unboxing Value Types6. Common Object OperationsObject Equality and Identity Implementing Equals for a Reference Type Whose Base Classes Don't Override Object's Equals Implementing Equals for a Reference Type When One or More of Its Base Classes Overrides Object's Equals Implementing Equals for a Value Type Summary of Implementing Equals and the ==/!= Operators IdentityObject Hash CodesObject Cloning

PART III DESIGNING TYPES7. Type Members and Their AccessibilityType MembersAccessibility Modifiers and Predefined Attributes Type Predefined Attributes Field Predefined Attributes Method Predefined Attributes8. Constants and FieldsConstantsFields9. MethodsInstance ConstructorsType ConstructorsOperator Overload Methods Operators and Programming Language InteroperabilityConversion Operator MethodsPassing Parameters by Reference to a MethodPassing a Variable Number of Parameters to a MethodHow Virtual Methods Are CalledVirtual Method Versioning10. PropertiesParameterless PropertiesParameterful Properties11. EventsDesigning a Type That Exposes an EventDesigning a Type That Listens for an EventExplicitly Controlling Event RegistrationDesigning a Type That Defines Lots of EventsDesigning the EventHandlerSet TypePART IV ESSENTIAL TYPES12. Working with TextCharactersThe System.String Type Constructing Strings Strings Are Immutable Comparing Strings String Interning String Pooling Examining a String's Characters Other String OperationsDynamically Constructing a String Efficiently Constructing a StringBuilder Object StringBuilder's MembersObtaining a String Representation for an Object Specific Formats and Cultures Formatting Multiple Objects into a Single String Providing Your Own Custom FormatterParsing a String to Obtain an ObjectEncodings: Converting Between Characters and Bytes Encoding/Decoding Streams of Characters and Bytes Base-64 String Encoding and Decoding13. Enumerated Types and Bit FlagsEnumerated TypesBit Flags14. ArraysAll Arrays Are Implicitly Derived from System.ArrayCasting ArraysPassing and Returning ArraysCreating Arrays That Have a Nonzero Lower BoundFast Array AccessRedimensioning an Array15. InterfacesInterfaces and InheritanceDesigning an Application That Supports Plug-In ComponentsChanging Fields in a Boxed Value Type Using InterfacesImplementing Multiple Interfaces That Have the Same MethodExplicit Interface Member Implementations16. Custom AttributesUsing Custom AttributesDefining Your Own AttributeAttribute Constructor and Field/Property Data TypesDetecting the Use of a Custom AttributeMatching Two Attribute Instances Against Each OtherPseudo-Custom Attributes17. DelegatesA First Look at DelegatesUsing Delegates to Call Back Static MethodsUsing Delegates to Call Back Instance MethodsDemystifying DelegatesSome Delegate History: System.Delegate and System.MulticastDelegateComparing Delegates for EqualityDelegate ChainsC#'s Support for Delegate ChainsHaving More Control over Invoking a Delegate ChainDelegates and Reflection

PART V MANAGING TYPES18. ExceptionsThe Evolution of Exception HandlingThe Mechanics of Exception Handling The try Block The catch Block The finally BlockWhat Exactly Is an Exception?The System.Exception ClassFCL-Defined Exception ClassesDefining Your Own Exception ClassHow to Use Exceptions Properly You Can't Have Too Many finally Blocks Don't Catch Everything Gracefully Recovering from an Exception Backing Out of a Partially Completed Operation When an Unrecoverable Exception Occurs Hiding an Implementation DetailWhat's Wrong with the FCLPerformance ConsiderationsCatch FiltersUnhandled Exceptions Controlling What the CLR Does When an Unhandled Exception Occurs Unhandled Exceptions and Windows Forms Unhandled Exceptions and ASP.NET Web Forms Unhandled Exceptions and ASP.NET XML Web ServicesException Stack Traces Remoting Stack TracesDebugging Exceptions Telling Visual Studio What Kind of Code to Debug19. Automatic Memory Management (Garbage Collection)Understanding the Basics of Working in a Garbage-Collected PlatformThe Garbage Collection AlgorithmFinalization What Causes Finalize Methods to Get Called Finalization InternalsThe Dispose Pattern: Forcing an Object to Clean Up Using a Type That Implements the Dispose Pattern C#'s using Statement An Interesting Dependency IssueWeak References Weak Reference InternalsResurrection Designing an Object Pool Using ResurrectionGenerationsProgrammatic Control of the Garbage CollectorOther Garbage Collector Performance Issues Synchronization-Free Allocations Scalable Parallel Collections Concurrent Collections Large ObjectsMonitoring Garbage Collections20. CLR Hosting, AppDomains, and ReflectionMetadata: The Cornerstone of the .NET FrameworkCLR HostingAppDomains Accessing Objects Across AppDomain Boundaries AppDomain Events Applications and How They Host the CLR and Manage AppDomains "Yukon"The Gist of ReflectionReflecting Over an Assembly's TypesReflecting Over an AppDomain's AssembliesReflecting Over a Type's Members: BindingExplicitly Loading Assemblies Loading Assemblies as "Data Files" Building a Hierarchy of Exception-Derived TypesExplicitly Unloading Assemblies: Unloading an AppDomainObtaining a Reference to a System.Type ObjectReflecting Over a Type's Members Creating an Instance of a Type Calling a Type's Method Bind Once, Invoke Multiple TimesReflecting Over a Type's InterfacesReflection Performance

Network Security Foundations

Author: Matthew Streb

The world of IT is always evolving, but in every area there are stable, core concepts that anyone just setting out needed to know last year, needs to know this year, and will still need to know next year. The purpose of the Foundations series is to identify these concepts and present them in a way that gives you the strongest possible starting point, no matter what your endeavor.

Network Security Foundations provides essential knowledge about the principles and techniques used to protect computers and networks from hackers, viruses, and other threats. What you learn here will benefit you in the short term, as you acquire and practice your skills, and in the long term, as you use them. Topics covered include: