作者:empty 页数:472 出版社:empty |
About the AuthorMany people say that by looking at a person's dog.you can tell what theperson is like.Well, the picture is of my dog Lou ys, an English bulldog.And yes, my English bulldog and I have many common characteristics.But what about the biography of the author.CHRISTIAN GROSS It's prettysimple:I'maguywhohasspentoodlesoftimestrappedtoachairdebuggingand taking apart code.In fact I really enjoy this business we call software development.I haveloved it ever since I learned howto peek and poke my first bytes.I have written various books,includingAjaxandRESTRecipes:AProblem-SolutionAppronch, Foundations of Object-OrientedProgramming Using.NET 2.0Parterns, A Programmer's Introduction to Windows DNA, andBeginning Ce:From Novice to Professional, all available from A pressThese days, I enjoy coding and experimenting with NET, as it is a fascinating environment.NET makes me feel ll kea kid opening a present on Christmas mom ing.You had an idea whatthe gitt was, but you were not completely sure.And with.NET, there is no relative giving yousocks or a sweater.It's excitement all the way!
About the Technical ReviewerANDY OLSEN is a freelance developer and consultant based in the UK.Andyhas been working with.NET since beta l days, and has coauthored andreviewed several books for A press, covering Ce, VisualBasic, ASP.NET,and other topics.Andy is a keen football and rugby fan, and enjoys running and s kling[badly i.He lives by the seaside in Swansea with his wife, Jayne, and children,Emily and Thomas, who have just discovered the thrills of surfing andlook much cooler than he ever will!
Contents
About the Author.
About the Technical Reviewer.
Introduction.
CHAPTER 1
U CONTENTS
CHAPTER 2
M CHAPTER 3
CHAPTER 4
Ready, Steady, Go!.
Downloading and Instal ing the Tools.
Choosing the Application Type.
Creating Projects and Solutions.
Creating the Windows Application
Navigating the User Controls of the Solution.
Crea ing the Console Application.
Creating the Class Library.
Understanding How the.NET Framework Works
The Important Stuff to Remember.
SomeThings for You to Do.
Downloading VisualBasic Express.
Installing VisualBasic Express.
Viewing the SourceCode.
Saving the Project.
Running the Windows Applica ion.
Making the Windows Application Say Hello.
Adding Comments to the Applicaton.
Organizing the Calculator.
Focusing the Calculator.
Writing the Add) Method.
Wrt ing Code to Test the AddO Method.
Understanding Problems with Numeric Numbers.
Understanding Value and Reference Types.
Understanding the CLR Numeric Types.
Creating the Translator Class.
Translating Hello.
Creating the Test Application.
Answering the Question of Responsi bi ity.
Investigating the StringType.
Solving the Extra Whitespace Problem.
Quoting Strings.
Character Mapping.
Seting Culture and Language n Windows
Parsing and Processing Numbers.
Working with Cultures.
Declaring Structures and Classes.
ValueType Constraints.
Adding a Console Application Project to the Solution.
Making the Console Application Say Hello.
Set tng the Startup Project.
Running the Console Project.
Adding a Class Library Project to the Solution
Moving Functionality.
Defining References.
Call ng Class Library Functionality.
Using Variables and Constants.
Learning About.NET Number and Value Types.
Focusing and Organ zing Your Development.
mple men ig the Class L bray.
Understanding Numeric and Value DataTypes.
Finishing the Calculator.
The Important Stuff to Remember.
SomeThings for You to Do.
Learning About String Manipulations.
Organizing the Translation Application.
Building the Translator Application.
Dealing with Languages and Cultures.
The Important Suff to Remember
SomeThings for You to Do.
Learning About DataStructures, Decisions,
and Loops.
Understanding the Depth-First Search Algo thm.
Implement ng User-Defined Types.
Defini g and Implement g the Da a Structure.
De in ing the Algorithm Test.
Implement ng the Depth-Fit Search Algo thm.
Running the Depth-First Search Algorithm.
Catching Exceptions.
Implementing Except on Handlers.
Safeguarding Against Stack Unwinding.
Filtering Exceptions.
Writing Defensive Code.
Using Default State.
Process ngE mors That ArWa rnigs.
GettingStarted with Structural Code.
Understanding Base Classes.
Understanding Inheritance.
Using VisualBasic Properties.
Understanding Inheritance and Scope Modifiers.
Handling Verifica ton.
Finishing the BaseClass.
Implementing Active Currency Trader.
Implementing Hotel Currency Trader.
More Preprocessor Directive Deals
More Property Scope Details.
The Must Override Keyword.
Representing lde as Using VisualBasic Interfaces.
Dening the Interfaces.
Implemen ing the Kem el.
Defining the Ke melAs an Interface Instead of a Class.
Defining Some Rooms.
n stan it ng Public Room and Priate Room.
CHAPTER 5
M CHAPTER 6
U CONTENTS
CHAPTER 7
CHAPTER 8
Learning About VisualBasic Exception Handling . 115
Understanding Errors, Exceptions, and Exception Hand ig.115
Running the Debugger.116
Handing Exceptions.117
Wring Exception-Safe Code.129
The Important Stuff to Remember.133
SomeThings for You to Do.134
Learning the Basics of
Object-Oriented Programming.135
Understanding Currency Spreads.136
Organizing the Currency Exchange Applicaton.137
Writing Tests for the Currency Exchange Application-.-.-.137
Wring the Act ve Trader and Hotel Trader Currency Converters . 152
Leaming More About Preprocessor Directv es, Properties, and the
Must Override Keyword.157
The Impart ant Stuff to Remember.
SomeThings for You to Do.
Learning About Components and Class Hierarchies . 163
Understanding Some Basic Tax Concepts.
Organizing the Tax Application.
Programming Using lde as.165
Implementing a Tax Engine.
Us ng the Base Funct on ty of the Tax Engine to Calculate Taxes . 182
Leaming More About Inheritance and Type Cas ng.
The Important Stuff to Remember.
SomeThings for You to Do.
Understanding How Inheritance and Components Work . 168
Defining the Interfaces.173
Implementing a BaseClass Tax Engine.174
Using Default Implementations.178
Implementing a Base Tax Account.180
Implementing a Tax Engine and Tax Account.182
Using the Tax Engine.187
More Inheritance Details.188
More Type-Casing Details.194
Learning About Component-Oriented Architecture . 197
Understanding Kem els.197
Organizing the Light ig Application.198
Building the Kem nel.199
Building a Complete Application.222
Leaming More About Pr vate Classes and Object Intial zation. 225
The Important Stuff to Remember.227
SomeThings for You to Do.228
Learning About Lists, Delegates, and
Private Classes.
Object in it lation wih Nested DataTypes.
Lambda Expressions.
Managing Collections.
Adding Numbers and Finding Maximum Values.
Using Delegates.
Understanding Lambda Expressions.
Leaming More About Collect on Types.
The lm pr tant Stuff to Remember.
SomeThings for You to Do.
Organizing the Lottery-Prediction System.
Piping Data Using a Console.
Piping Binary Data.
Tweaking Sera zain.
Completing Custom Types.
The l mportant Stuff to Remember.
SomeThings for You to Do.
CHAPTER 9
Managing a Collection Before VisualBasic 2005.
Managing a Collection After VisualBasic 2005.
Declaring the Delegate.
Implementing Methods That Match the Delegate.
Using a Plain-Vanilla List.
Using a Key N alue Pair List.
Using a Stack.
Using a Queue.
Reading Data from the Console.
Building a Shell.
Implemen ing the Text Processor Api cation.
Designing the Architecture.
Defining the Server Spreadsheet Interfaces.
Using Lambda Expressions in the Spreadsheet.
Assigning State Without Knowing the Type.
Overriding the To Strng 0 Functionality.
Calculating an Average.
Understanding Why the Calculation Worked.
Dec ou ling Using a Conf gur at in Architecture.
Decoupling Using a Convention Architecture.
Signing an Assembly.
Seting the Output Path.
Creating an XML-Based Configuration File.
Adding the Dynamic Loading Configuration items.
Reading a Configuration File.
Dynamically Instantiating a Type.
Enhancing the Configuration File.
CHAPTER 10 Learning About Persistence.
I CONTENTS
CHAPTER 11
Defining the Interfaces and Implement ng the Shell.
Defining the Type.
Converting a Text Stream into a Binary Stream.
Conver in ga Binary Stream into a Text Stream . 275
Performing Custom Seria zation.
Dec laing a Data Member As Non seal z able.278
Separating DataObjects from Action Objects . 278
Implementing GetHashCode) .
Implement ng Equals 0.282
Learning About.NET Generics.
Why Use.NET Generics?.
The Theory of a Server-Side Spreadsheet.
Architec in ga Server-Side Spreadsheet.
Implemen ng the Server Spreadsheet.
Using the Spreadsheet.
The Important Stuff to Remember.
SomeThings for You to Do.
and Dynamic Loading.
Convention over Configuration.
Setting Up the Dynamic Loading Projects.316
Defining and Processing a Confi uration Fle
Dynamically Loading an Assembly.
Loading a Strongly Named Assem by.
CHAPTER 12 Learning About Application Configuration
Relocating aS ron gly Named Assem by to the GAC. 333
Using Version Numbers.333
Implement ga Shared Typed Convention-Based Architecture . 337
Dynamically Loading BaseClass or Interface Types.339
The Important Stuff to Remember.,33g
SomeThings for You to Do.340
Understanding Mit asking.341
Using Threads.
Implementing a Reader/Writer Threaded Architecture . 359
Implementing a Producer/Consumer Architecture.
The Important Stuff to Remember.
SomeThings for You to Do.
CHAPTER 13 Learning About Multithreading.
M CHAPTER 14
I CONTENTS
CHAPTER 15 Learning About LINQ.
Preemptive Mulit asking.
Time Slicing.
Creating a New Thread.
Waiting for the Thread to End,
creating a Thread with Sate.
Synchronizing Between Threads.
How Not to Deadlock Your Code(Most iy) .
Relational Database Tables.
Database Relations.
Configuring the DataSource.
Adding the Tables.
Connecting to a Database.
Closing a Database Connection.
Adding Table Data.
Selecting Da a from a Table.
Deleting Data from the Database.
Recapping A DO.NET Usage.
Bull ding Relations Between Tables.
Using the Generated Code.
Extending the Lottery-Prediction System.
Implementing a Frequency Solution.
Selec ing and Altering Data.
Select ng with Anonymous Types.
Processing MultipleS teams.
Sorting the Results.
Performing Set Opera tns.
Using Ahmet ic Operators.
Overloading Operators.
Using the Type Const rant.
Using the New Constraint.
Using the Class Constraint.
t.mt.t.
Using a Hidden Producer/Consumer Implementation . 363
Implementing a Generic Producer/Consumer Architecture . 354
Using an Asynchronous Approach.367
Learning About Relational Database Data.371
Understanding Rela tonal Databases.371