SlideShare a Scribd company logo
Visit ebookfinal.com to download the full version and
explore more ebooks or textbooks
Developer s Guide to Microsoft Enterprise Library
Visual Basic Edition Patterns Practices Alex Homer
_____ Click the link below to download _____
https://ebookfinal.com/download/developer-s-guide-to-
microsoft-enterprise-library-visual-basic-edition-patterns-
practices-alex-homer/
Explore and download more ebooks or textbook at ebookfinal.com
Here are some recommended products that we believe you will be
interested in. You can click the link to download.
NET application architecture guide 2nd ed Edition
Microsoft Patterns & Practices Team
https://ebookfinal.com/download/net-application-architecture-
guide-2nd-ed-edition-microsoft-patterns-practices-team/
Clearly Visual Basic Programming with Microsoft Visual
Basic 2010 2nd Edition Diane Zak
https://ebookfinal.com/download/clearly-visual-basic-programming-with-
microsoft-visual-basic-2010-2nd-edition-diane-zak/
Cocoon Developer s Handbook Developer s Library 1st
Edition Lajos Moczar
https://ebookfinal.com/download/cocoon-developer-s-handbook-developer-
s-library-1st-edition-lajos-moczar/
mod_perl Developer s Cookbook Developer s Library 1st
Edition Geoffrey Young
https://ebookfinal.com/download/mod_perl-developer-s-cookbook-
developer-s-library-1st-edition-geoffrey-young/
Mastering Microsoft Visual Basic 2010 1st Edition
Evangelos Petroutsos
https://ebookfinal.com/download/mastering-microsoft-visual-
basic-2010-1st-edition-evangelos-petroutsos/
VSTO for Mere Mortals TM A VBA Developer s Guide to
Microsoft Office Development Using Visual Studio 2005
Tools for Office 1st Edition Kathleen Mcgrath
https://ebookfinal.com/download/vsto-for-mere-mortals-tm-a-vba-
developer-s-guide-to-microsoft-office-development-using-visual-
studio-2005-tools-for-office-1st-edition-kathleen-mcgrath/
Microsoft Visual Basic Game Programming for Teens 2nd
Edition Jonathan S.(Jonathan S. Harbour) Harbour
https://ebookfinal.com/download/microsoft-visual-basic-game-
programming-for-teens-2nd-edition-jonathan-s-jonathan-s-harbour-
harbour/
Microsoft Visual Basic NET Programming for the Absolute
Beginner 1st Edition Jonathan S. Harbour
https://ebookfinal.com/download/microsoft-visual-basic-net-
programming-for-the-absolute-beginner-1st-edition-jonathan-s-harbour/
Visual Writing Alex Baratta
https://ebookfinal.com/download/visual-writing-alex-baratta/
Developer s Guide to Microsoft Enterprise Library Visual Basic Edition Patterns Practices Alex Homer
Developer s Guide to Microsoft Enterprise Library Visual
Basic Edition Patterns Practices Alex Homer Digital
Instant Download
Author(s): Alex Homer, Nicolas Botto, Bob Brumfield, Grigori Melnik, Erik
Renaud, Fernando Simonazzi, Chris Tavares
ISBN(s): 9780735651777, 0735651779
Edition: 1
File Details: PDF, 3.70 MB
Year: 2010
Language: english
D E V E LO P E R ’ S GU I D E TO
M I C R O S O F T
®
EN T E R P R I S E
LI B R A RY
Alex Homer
with
Nicolas Botto
Bob Brumfield
Olaf Conijn
Grigori Melnik
Erik Renaud
Fernando Simonazzi
Chris Tavares
Solutions for
Enterprise Development
Visual Basic Edition
developer’s guide to microsoft®
enterprise library
D
ownload
from
Wow!
eBook
<www.wowebook.com>
Developer s Guide to Microsoft Enterprise Library Visual Basic Edition Patterns Practices Alex Homer
developer’s guide to
Microsoft®
Enterprise
Library
Solutions for Enterprise Development
Alex Homer
with
Nicolas Botto
Bob Brumfield
Olaf Conijn
Grigori Melnik
Erik Renaud
Fernando Simonazzi
Chris Tavares
Copyright and Terms of Use
ISBN: 9780735651777
This document is provided “as-is.” Information and views expressed in
this document, including URL and other Internet Web site references,
may change without notice. You bear the risk of using it.
Some examples depicted herein are provided for illustration only and
are fictitious. No real association or connection is intended or should
be inferred.
This document does not provide you with any legal rights to any
intellectual property in any Microsoft product. You may copy and
use this document for your internal, reference purposes.
© 2010 Microsoft. All rights reserved.
Microsoft, Windows, Windows Server, Windows Vista, Visual C#,
SQL Server, Active Directory, IntelliSense, Silverlight, MSDN, Internet
Explorer, and Visual Studio are trademarks of the Microsoft group of
companies. All other trademarks are property of their respective owners.
Contents
preface xv
About This Guide xv
What Does This Guide Cover? xv
What This Guide Does Not Cover xvi
How Will This Guide Help You? xvii
What Do You Need to Get Started? xvii
the team who brought you this guide xix
The Enterprise Library 5.0 Development Team xix
1 Welcome to the Library 1
Meet the Librarian 1
What You Get with Enterprise Library 1
Things You Can Do with Enterprise Library 3
Why You Should Use Enterprise Library 4
Some Fundamentals of Enterprise Library 6
Choosing Which Blocks To Install 6
Installing Enterprise Library 7
Assemblies And References 7
GAC or Bin, Signed or Unsigned? 8
Importing Namespaces 9
Configuring Enterprise Library 10
The Configuration Tools 10
Using The Configuration Tools 11
Encrypting Configuration Sections 14
Instantiating and Using Enterprise Library Objects 14
Enterprise Library Objects, Facades, and Factories 15
foreword
Scott Guthrie xiii
Creating Instances of Enterprise Library Types 15
The Simple Approach
— Using The Enterprise Library Service Locator 16
The Sophisticated Approach
— Accessing The Container Directly 16
Pros and Cons of Object Instantiation 18
More Reasons to be Sophisticated 19
Getting Objects From Previous Versions
Of Enterprise Library 21
The Example Applications 22
Summary 23
2 Much ADO about Data Access 25
Introduction 25
What Does the Data Access Application Block Do? 26
Data Operations Supported by the Data Access Block 26
How Do I Use the Data Access Block? 28
Configuring the Block and Referencing the Required Assemblies 28
Creating Database Instances 29
The Example Application 30
Reading Multiple Data Rows 31
Reading Rows Using a Query with No Parameters 31
Reading Rows Using an Array of Parameter Values 32
Reading Rows Using Queries with Named Parameters 33
Retrieving Data as Objects 35
About Accessors 35
Creating and Executing an Accessor 37
Creating and Using Mappers 38
Retrieving Xml Data 39
Retrieving Single Scalar Values 40
Retrieving Data Asynchronously 41
Preparing for Asynchronous Data Access 42
Retrieving Row Set Data Asynchronously 43
Retrieving Data as Objects Asynchronously 45
Updating Data 45
Executing an Update Query 46
Working with DataSets 47
Updating the Database from a DataSet 48
Managing Connections 52
Working with Connection-Based Transactions 53
Working with Distributed Transactions 55
Extending the Block to Use Other Databases 58
Summary 58
3 Error Management Made Exceptionally Easy 61
Introduction 61
When Should I Use the Exception Handling Block? 62
How Do I Use the Exception Handling Block? 62
What Exception Policies Do I Need? 63
Allowing Exceptions to Propagate 63
About Exception Handling Policies 63
Choosing an Exception Handling Strategy 65
Process or Handle Exception? 66
Using the Process Method 67
Diving in with a Simple Example 68
Applying Exception Shielding 69
Wrapping an Exception 70
Configuring the Wrap Handler Policy 70
Initializing the Exception Handling Block 71
Editing the Application Code to Use the New Policy 71
Replacing an Exception 74
Logging an Exception 75
Shielding Exceptions at WCF Service Boundaries 78
Creating a Fault Contract 78
Configuring the Exception Handling Policy 78
Editing the Service Code to Use the New Policy 79
The Fault Contract Exception Handler 80
Handling Specific Exception Types 82
Executing Code around Exception Handling 83
Assisting Administrators 85
Extending Your Exception Handling 87
Summary 87
4 As Easy as Falling Off a Log 89
Introduction 89
What Does the Logging Block Do? 90
Logging Categories 92
Logging Overhead and Additional Context Information 93
How Do I Use the Logging Block? 93
Configuring the Logging Block 93
Initializing the Logging Block 94
Diving In with an Example 95
Creating and Writing Log Entries with a Logwriter 95
About Logging Categories 98
Filtering by Category 100
Writing Log Entries to Multiple Categories 100
Controlling Output Formatting 101
Non-Formatted Trace Listeners 102
Filtering by Severity in a Trace Listener 103
Filtering All Log Entries by Priority 103
Creating and Using Logentry Objects 104
Capturing Unprocessed Events and Logging Errors 105
About Special Sources 105
An Example of Using Special Sources 106
Logging to a Database 108
Using the Database Trace Listener 109
Testing Logging Filter Status 110
Obtaining Information about Trace Sources
and Trace Listeners 111
Checking if Filters Will Block a Log Entry 112
Adding Additional Context Information 114
Tracing and Correlating Activities 115
An Example of Tracing Activities 116
Creating Custom Trace Listeners, Filters, and Formatters 119
Summary 119
5 A Cache Advance for Your Applications 121
Introduction 121
What Does the Caching Block Do? 123
Flushed or Expired? 123
Which Expiration Policy? 124
How Do I Configure the Caching Block? 124
Persistent Caching 125
Encrypting Cached Items 126
Initializing the Caching Block 126
How Do I Use the Caching Block? 127
About the Example Application 127
Adding Items to and Retrieving Items from the Cache 127
What’s In My Cache? 130
Using the Isolated Storage Backing Store 131
Encrypting the Cached Data 133
Using the Database Backing Store 134
Removing Items From and Flushing the Cache 135
Using a File Dependency and Extended Time Expiration 136
Adding the Items to the Cache 137
Refreshing the Cache 139
Loading the Cache 141
Proactive Cache Loading 141
Reactive Cache Loading 142
Extending Your Cache Advance 143
Summary 144
D
ownload
from
Wow!
eBook
<www.wowebook.com>
6 Banishing Validation Complication 145
Introduction 145
Techniques for Validation 146
Where Should I Validate? 146
What Should I Validate? 146
How Should I Validate? 147
What Does the Validation Block Do? 147
The Range of Validators 149
Validating with Attributes 151
DataAnnotations Attributes 151
Self-Validation 152
Validation Rule Sets 154
Assigning Validation Rules to Rule Sets 154
Configuring Validation Block Rule Sets 154
Specifying Rule Sets When Validating 155
How Do I Use The Validation Block? 156
Preparing Your Application 156
Choosing a Validation Approach 157
Options for Creating Validators Programmatically 158
Performing Validation and Displaying Validation Errors 159
Understanding Message Template Tokens 160
Diving in With Some Simple Examples 161
Validating Objects and Collections of Objects 162
Creating a Type Validator using the ValidatorFactory 162
Delving Deeper into ValidationResults 163
Using the Object Validator 164
Differences Between the Object Validator
and the Factory-Created Type Validators 164
Validating Collections of Objects 165
Using Validation Attributes 166
Using the Validation Block Attributes 166
Using Data Annotation Attributes 169
Defining Attributes in Metadata Classes 171
Specifying the Location of Validation Rules 172
Creating and Using Individual Validators 173
Validating Strings for Contained Characters 173
Validating Integers within a Domain 173
Validating with a Composite Validator 174
Validating Single Members of an Object 174
WCF Service Validation Integration 176
Defining Validation in the Service Contract 176
Editing the Service Configuration 177
Using the Product Service and Detecting Validation Errors 178
User Interface Validation Integration 180
ASP.NET User Interface Validation 180
Windows Forms User Interface Validation 181
WPF User Interface Validation 181
Creating Custom Validators 182
Summary 182
7 Relieving Cryptography Complexity 183
Introduction 183
What Does the Cryptography Block Do? 183
A Secret Shared 184
Making a Hash of It 184
How Does the Cryptography Block Manage
Encryption Keys? 184
How Does the Cryptography Block Integrate
With Other Blocks? 185
How Do I Use the Cryptography Block? 185
Configuring Cryptographic Providers 186
Adding the Required References 187
Diving in with an Example 187
Encrypting and Decrypting Data Using
A Symmetric Provider 188
Encrypting and Decrypting a Text String 188
Encrypting and Decrypting an Object Instance 189
Obtaining and Comparing Hash Values 191
Creating and Comparing Hash Values for Text Strings 191
Creating and Comparing Hash Values for Object Instances 193
Creating Custom Cryptography Providers 195
Summary 196
8 An Authentic Approach to Token Identity 197
Introduction 197
What Does the Security Block Do? 198
What are Authorization Rule Providers? 198
About Authorization Manager (AzMan) 198
Why Do I Need a Security Cache? 199
How Do I Configure the Security Block? 200
Configuring Authorization Rules 202
How Do I Use the Security Block? 202
Diving in With an Example 203
Caching a User Identity and Obtaining
A Temporary Token 204
Displaying User Identity Details 205
Displaying Generic Principal Details 205
Authenticating a User Using a Token 206
Terminating a User Session and Expiring the Token 207
Checking If a User is Authorized to Perform a Task 208
Using Security Block Configured Rules 208
Using AzMan Provider Rules 210
Creating Custom Authorization Providers 212
Summary 212
appendices
a dependency injection with unity 213
What is Dependency Injection? 213
The Unity Dependency Injection and Interception Mechanism 214
Summary of Unity Features 215
Defining Dependencies with Unity 216
Constructor Injection 217
Automatic Constructor Injection 217
Design-Time Configuration 218
Run-Time Configuration 219
Configuration with Attributes 219
Property (Setter) Injection 220
Design-Time Configuration 220
Run-Time Configuration 221
Configuration with Attributes 221
Method Call Injection 222
Design-Time Configuration 223
Run-Time Configuration 223
Configuration with Attributes 223
More Dependency Injection Opportunities 224
Resolving Populated Instances of Your Classes 224
b dependency injection in enterprise library 227
Loading Configuration Information into a Unity Container 227
Viewing Registrations in the Container 228
Populating Entire Object Graphs at Application Startup 229
Maintaining a Container Reference in Request-Based
Applications 230
Using an Alternative Service Locator or Container 231
c policy injection in enterprise library 233
d enterprise library configuration scenarios 235
About Enterprise Library Configuration 235
External Configuration 236
Programmatic Support 236
Using the Fluent Interfaces 236
Scenarios for Advanced Configuration 237
scenario 1: Using The Default Application
Configuration File 237
scenario 2: Using A Non-Default Configuration Store 237
scenario 3: Sharing The Same Configuration
Between Multiple Applications 238
scenario 4: Managing And Enforcing Configuration
For Multiple Applications 238
scenario 5: Sharing Configuration Sections
Across Multiple Applications 239
scenario 6: Applying a Common Configuration
Structure for Applications 240
Deployment Environments 241
e encrypting configuration files 243
index 245
xiii
Foreword
You are holding in your hands a book that will make your life as an enterprise developer a
whole lot easier.
It’s a guide on Microsoft Enterprise Library and it’s meant to guide you through how
to apply .NET for enterprise development. Enterprise Library, developed by the patterns
& practices group, is a collection of reusable components, each addressing a specific cross
cutting concern—be it system logging, or data validation, or exception management.
Many of these can be taken advantage of easily. These components are architecture
agnostic and can be applied in a multitude of different contexts.
The book walks you through functional blocks of the Enterprise Library, which
include data access, caching, cryptography, exception handling, logging, security, and
validation. It contains a large collection of exercises, tricks and tips.
Developing robust, reusable, and maintainable application requires knowledge of
design patterns, software architectures and solid coding skills. We can help you develop
those skills with Enterprise Library since it encapsulates proven and recommended prac-
tices of developing enterprise applications on the .NET platform. Though this guide does
not go into the depth of discussions of architecture and patterns, it provides a solid basis
for you to discover and implement these patterns from a reusable set of components.
That’s why I also encourage you to check out the Enterprise Library source code and
read it.
This guide is not meant to be a complete reference on Enterprise Library. For that,
you should go to MSDN. Instead, the guide covers most commonly used scenarios and
illustrates how Enterprise Library can be applied in implementing those. The powerful
message manifesting from the guide is the importance of code reuse. In today’s world of
complex large software systems, high-quality pluggable components are a must. After all,
who can afford to write and then maintain dozens of different frameworks in a system—
all to accomplish the same thing? Enterprise Library allows you to take advantage of the
proven code complements to manage a wide range of task and leaves you free to concen-
trate on the core business logic and other “working parts” of your application.
Another important emphasis that the guide makes is on software designs, which are
easy to configure, testable and maintainable. Enterprise Library has a flexible configura-
tion subsystem driven from either external config files, or programmatically, or both.
Leading by example, Enterprise Library itself is designed in a loosely-coupled manner. It
promotes key design principles of the separation of concerns, single responsibility prin-
ciple, principle of least knowledge and the DRY principle (Don’t Repeat Yourself). Having
said this, don’t expect this particular guide to be a comprehensive reference on design
patterns. It is not. It provides just enough to demonstrate how key patterns are used with
Enterprise Library. Once you see and understand them, try to extrapolate them to other
problems, contexts, scenarios.
The authors succeeded in writing a book that is targeted at both those who are sea-
soned Enterprise Library developers and who would like to learn about the improvements
in version 5.0, and those, who are brand new to Enterprise Library. Hopefully, for the
first group, it will help orientate you and also get a quick refresher of some of the key
concepts. For the second group, the book may lower your learning curve and get you
going with Enterprise Library quickly.
Lastly, don’t just read this book. It is meant to be a practical tutorial. And learning
comes only through practice. Experience Enterprise Library. Build something with it.
Apply the concepts learnt in practice. And don’t forget to share your experience.
In conclusion, I am excited about both the release of Enterprise Library 5.0 and this
book. Especially, since they ship and support some of our great new releases—Visual
Studio 2010, .NET Framework 4.0 and Silverlight 4, which together will make you, the
developer, ever more productive.
Scott Guthrie
Corporate Vice-President
Microsoft .NET Developer Platform
Redmond, Washington
D
ownload
from
Wow!
eBook
<www.wowebook.com>
xv
Preface
About This Guide
When you casually pick up a book in your local bookstore or select one from the endless
collection available on your favorite Web site, you’re probably wondering what the book
actually covers, what you’ll learn from it, whether the content is likely to be interesting
and useful, and—of course—whether it is actually any good. We’ll have a go at answering
the first three of these questions here. The final question is one only you can answer. Of
course, we would be pleased to hear your opinion through our community Web site at
http://entlib.codeplex.com/.
what does this guide cover?
As you can probably tell from the title, this guide concentrates on how you can get
started with Enterprise Library. It will help you learn how to use Enterprise Library in your
applications to manage your crosscutting concerns, simplify and accelerate your develop-
ment cycle, and take advantage of proven practices. Enterprise Library is a collection of
prewritten code components that have been developed and fine-tuned over many years.
You can use them out of the box, modify them as required, and distribute them with your
applications. You can even use Enterprise Library as a learning resource. It includes the
source code that demonstrates Microsoft®.NET programming techniques and the use of
common design patterns that can improve the design and maintainability of your applica-
tions. By the way, if you are not familiar with the term crosscutting concerns, don’t worry;
we’ll explain it as we go along.
Enterprise Library is an extensive collection, with a great many moving parts. To the
beginner knowing how to best take advantage of it is not completely intuitive. Therefore,
in this guide we’ll help you to quickly understand what Enterprise Library is, what it
contains, how you can select and use just the specific features you require, and how easy
it is to get started using them. You will see how you can quickly and simply add Enterprise
Library to your applications, configure it to do exactly what you need, and then benefit
from the simple-to-use, yet extremely compelling opportunities it provides for writing
less code that achieves more.
The first chapter of this guide discusses Enterprise Library in general, and provides
details of the individual parts so that you become familiar with the framework as a whole.
xvi
The aim is for you to understand the basic principles of each of the application blocks in
Enterprise Library, and how you can choose exactly which blocks and features you re-
quire. Chapter 1 also discusses the fundamentals of using the blocks, such as how to
configure them, how to instantiate the components, and how to use these components
in your code.
The remaining seven chapters discuss in detail the application blocks that provide the
basic crosscutting functionality such as data access, caching, logging, and exception han-
dling. These chapters explain the concepts that drove development of the blocks, the
kinds of tasks they can accomplish, and how they help you implement many well-known
design patterns. And, of course, they explain—by way of code extracts and sample pro-
grams—how you actually use the blocks in your applications. After you’ve read each
chapter, you should be familiar with the block and be able to use it to perform a range of
functions quickly and easily, in both new and existing applications.
Finally, the appendices present more detailed information on specific topics that you
don’t need to know about in detail to use Enterprise Library, but are useful as additional
resources and will help you understand how features such as dependency injection, inter-
ception, and encryption fit into the Enterprise Library world.
You can also download and work through the Hands-On Labs for Enterprise Library,
which are available at http://go.microsoft.com/fwlink/?LinkId=188936.
what this guide does not cover
The aim of this guide is to help you learn how to benefit from the capabilities of Enter-
prise Library. It does not describe the common design patterns in depth, or attempt to
teach you about application architecture in general. Instead, it concentrates on getting
you up to speed quickly and with minimum fuss so you can use Enterprise Library to
manage your crosscutting concerns.
One of the core tenets of modern application design is that you should reduce the
coupling or dependencies between components and objects, and Enterprise Library ver-
sion 5.0 helps you achieve this goal through use of the Dependency Injection (DI) design
pattern. However, you do not have to be a DI expert to use Enterprise Library; all of the
complexity is managed internally by the core mechanisms within the framework. While
we do explain the basic use of DI in terms of Enterprise Library, that is not a fundamental
feature of this guide.
Enterprise Library is designed to be extensible. You can extend it simply by writing
custom plug-in providers, by modifying the core code of the library, or even by creating
entirely new blocks. In this guide, we provide pointers to how you can do this and explain
the kinds of providers that you may be tempted to create, but it is not a topic that we
cover in depth. These topics are discussed more fully in the documentation installed with
Enterprise Library and available online at http://go.microsoft.com/fwlink/?LinkId=188874,
and in the many other resources available from our community Web site at http://www.
codeplex.com/entlib.
For more information about the Dependency Injection (DI) design pattern and the
associated patterns, see “Inversion of Control Containers and the Dependency Injection
pattern” at http://martinfowler.com/articles/injection.html.
xvii
how will this guide help you?
If you build applications that run on the Microsoft .NET Framework, whether they
are enterprise-level business applications or even relatively modest Windows® Forms,
Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF),
or ASP.NET applications, you can benefit from Enterprise Library. This guide helps you to
quickly grasp what Enterprise Library can do for you, presents examples that show it in
action, and make it easier for you to start experimenting with Enterprise Library.
The sample applications are easy to assimilate, fully commented, and contain code
that demonstrates all of the main features. You can copy this code directly into your
applications if you wish, or just use it as a guide when you need to implement the common
functionality it provides. The samples are console-based applications that contain sepa-
rate procedures for each function they demonstrate. You can download these samples
from http://go.microsoft.com/fwlink/?LinkId=189009.
Finally, what is perhaps the most important feature of this guide is that it will hope-
fully allay any fears you may have about using other people’s code in your applications. By
understanding how to select exactly the features you need, and installing the minimum
requirements to implement these features, you will see that what might seem like a huge
and complicated framework is actually a really useful set of individual components
and features from which you can pick and choose—a candy store for the architect and
developer.
What Do You Need to Get Started?
The prerequisites for using this guide are relatively simple. You’ll need to be relatively
experienced in Visual Basic, and understand general object-oriented programming tech-
niques. The system requirements and prerequisites for using Enterprise Library are:
• Supported architectures: x86 and x64.
• Operating system: Microsoft Windows® 7 Professional, Enterprise, or Ultimate;
Windows Server® 2003 R2; Windows Server 2008 with Service Pack 2; Win-
dows Server 2008 R2; Windows Vista® with Service Pack 2; or Windows XP
with Service Pack 3.
• Microsoft .NET Framework 3.5 with Service Pack 1 or Microsoft .NET
Framework 4.0.
• For a rich development environment, the following are recommended:
• Microsoft Visual Studio® 2008 Development System with Service Pack
1 (any edition) or Microsoft Visual Studio 2010 Development System
(any edition).
• To run the unit tests, the following are also required:
• Microsoft Visual Studio 2008 Professional, Visual Studio 2008 Team
Edition, Visual Studio 2010 Premium, Visual Studio 2010 Professional,
or Visual Studio 2010 Ultimate Edition.
• Moq v3.1 assemblies.
xviii
• For the Data Access Application Block, the following is also required:
• A database server running a database that is supported by a .NET
Framework 3.5 with Service Pack 1 or .NET Framework 4.0 data
provider. This includes Microsoft SQL Server® 2000 or later, SQL
Server 2005 Compact Edition, and Oracle 9i or later. The database
server can also run a database that is supported by the .NET
Framework 3.5 with Service Pack 1 or the .NET Framework 4.0 data
providers for OLE DB or ODBC.
• For the Logging Application Block, the following are also required:
• Stores to maintain log messages. If you are using the MSMQ trace
listener to store log messages, you need the Microsoft Message
Queuing (MSMQ) component installed. If you are using the Database
trace listener to store log messages, you need access to a database
server. If you are using the Email trace listener to store log messages,
you need access to an SMTP server.
Other than that, all you require is some spare time to sit and read, and to play with the
example programs. Hopefully you will find the contents interesting (and perhaps even
entertaining), as well as a useful source for learning about Enterprise Library.
xix
Idea/Vision Grigori Melnik
Main Author Alex Homer
Contributing Authors Nicolas Botto, Bob Brumfield, Olaf Conijn, Grigori Melnik,
Erik Renaud, Fernando Simonazzi, and Chris Tavares.
Reviewers Scott Densmore, Tom Hollander, Hernan de Lahitte, Ajoy
Krishnamoorthy, Ade Miller, and Don Smith.
Graphic Artists Patrick Lanfear and Tom Draper.
Editors RoAnn Corbisier and Nancy Michell.
the enterprise library 5.0 development team
Product/Program
Management Grigori Melnik (Microsoft Corporation).
Architecture/
Development Bob Brumfield and Chris Tavares (Microsoft Corporation);
Fernando Simonazzi (Clarius Consulting); Nicolas Botto
(Digit Factory); and Olaf Conijn (Olaf Conijn BV).
Testing Carlos Farre, Masashi Narumoto, and Rohit Sharma
(Microsoft Corporation); Nicolas Botto (Digit Factory);
Lavanya Selvaraj, Magdelene Sona, Mani Krishnaswami,
Meenakshi Krishnamoorthi, Santhosh Panneerselvam,
and Ravindra Varman (Infosys Technologies Ltd); Erik
Renaud and François Tanguay (nVentive Inc); and Rick
Carr (DCB Software Testing, Inc).
User Experience Damon van Vessem, Heidi Adkisson, Jen Amsterlaw, and
Kelly Franznick (Blink Interactive); and Brad Cunningham
(Interknowlodgy).
Documentation Alex Homer (Microsoft Corporation) and Dennis DeWitt
(Linda Werner &Associates Inc).
the team who brought you this guide
Discovering Diverse Content Through
Random Scribd Documents
(Larger)
CHRISTMAS SUPPLEMENT TO Harper’s Weekly
(BLUE BEARD
RED RIDING HOOD
TOM THUMB
SANTA
CLAUS
PUSS IN BOOTS.
PEACE ON EARTH AND GOOD WILL TOWARD MEN!
CINDERELLA.)
(Larger)
A MERRY CHRISTMAS.
(Larger)
“Merry Christmas to all, and to all a good-night.”
(Larger)
“Wishing you a Merry Christmas and a Happy New Year.”
(Larger)
’TWAS THE NIGHT AFTER CHRISTMAS.
Transcriber’s Notes
Punctuation, hyphenation, and spelling were made
consistent when a predominant preference was found in the
original book; otherwise they were not changed.
Simple typographical errors were corrected; unbalanced
quotation marks were remedied when the change was
obvious, and otherwise left unbalanced.
This book does not have page numbers.
Transcriber added sequence numbers to the entries in the
Table of Contents.
When illustrations did not have captions, Transcriber
added them by using part of the corresponding entry in the
Table of Contents, or text within the illustrations themselves.
Transcriber added words and phrases that were within
some of the illustrations to their captions, and enclosed them
in parentheses to indicate they were not parts of the original
captions.
The first illustration is the cover.
The original book was autographed. A copy of that is
included in this eBook as the second illustration.
*** END OF THE PROJECT GUTENBERG EBOOK THOMAS
NAST'S CHRISTMAS DRAWINGS FOR THE HUMAN RACE ***
Updated editions will replace the previous one—the old editions will
be renamed.
Creating the works from print editions not protected by U.S.
copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying copyright
royalties. Special rules, set forth in the General Terms of Use part of
this license, apply to copying and distributing Project Gutenberg™
electronic works to protect the PROJECT GUTENBERG™ concept
and trademark. Project Gutenberg is a registered trademark, and
may not be used if you charge for an eBook, except by following the
terms of the trademark license, including paying royalties for use of
the Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is very
easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.
START: FULL LICENSE
THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
To protect the Project Gutenberg™ mission of promoting the free
distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.
Section 1. General Terms of Use and
Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund from
the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.
1.B. “Project Gutenberg” is a registered trademark. It may only be
used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law in
the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name
associated with the work. You can easily comply with the terms of
this agreement by keeping this work in the same format with its
attached full Project Gutenberg™ License when you share it without
charge with others.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the terms
of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
1.E. Unless you have removed all references to Project Gutenberg:
1.E.1. The following sentence, with active links to, or other
immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears, or
with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
1.E.2. If an individual Project Gutenberg™ electronic work is derived
from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.
1.E.3. If an individual Project Gutenberg™ electronic work is posted
with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning of
this work.
1.E.4. Do not unlink or detach or remove the full Project
Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.
1.E.5. Do not copy, display, perform, distribute or redistribute this
electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1 with
active links or immediate access to the full terms of the Project
Gutenberg™ License.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or expense
to the user, provide a copy, a means of exporting a copy, or a means
of obtaining a copy upon request, of the work in its original “Plain
Vanilla ASCII” or other form. Any alternate format must include the
full Project Gutenberg™ License as specified in paragraph 1.E.1.
1.E.7. Do not charge a fee for access to, viewing, displaying,
performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.
1.E.8. You may charge a reasonable fee for copies of or providing
access to or distributing Project Gutenberg™ electronic works
provided that:
• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You provide a full refund of any money paid by a user who
notifies you in writing (or by e-mail) within 30 days of receipt that
s/he does not agree to the terms of the full Project Gutenberg™
License. You must require such a user to return or destroy all
copies of the works possessed in a physical medium and
discontinue all use of and all access to other copies of Project
Gutenberg™ works.
• You provide, in accordance with paragraph 1.F.3, a full refund of
any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™
electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.
1.F.
1.F.1. Project Gutenberg volunteers and employees expend
considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.
1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except
for the “Right of Replacement or Refund” described in paragraph
1.F.3, the Project Gutenberg Literary Archive Foundation, the owner
of the Project Gutenberg™ trademark, and any other party
distributing a Project Gutenberg™ electronic work under this
agreement, disclaim all liability to you for damages, costs and
expenses, including legal fees. YOU AGREE THAT YOU HAVE NO
REMEDIES FOR NEGLIGENCE, STRICT LIABILITY, BREACH OF
WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE
PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE THAT THE
FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.
1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you
discover a defect in this electronic work within 90 days of receiving it,
you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or entity
that provided you with the defective work may elect to provide a
replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.
1.F.4. Except for the limited right of replacement or refund set forth in
paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
1.F.5. Some states do not allow disclaimers of certain implied
warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.
1.F.6. INDEMNITY - You agree to indemnify and hold the
Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and distribution
of Project Gutenberg™ electronic works, harmless from all liability,
costs and expenses, including legal fees, that arise directly or
indirectly from any of the following which you do or cause to occur:
(a) distribution of this or any Project Gutenberg™ work, (b)
alteration, modification, or additions or deletions to any Project
Gutenberg™ work, and (c) any Defect you cause.
Section 2. Information about the Mission of
Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.
Volunteers and financial support to provide volunteers with the
assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.
Section 3. Information about the Project
Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.
The Foundation’s business office is located at 809 North 1500 West,
Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many small
donations ($1 to $5,000) are particularly important to maintaining tax
exempt status with the IRS.
The Foundation is committed to complying with the laws regulating
charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.
While we cannot and do not solicit contributions from states where
we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.
International donations are gratefully accepted, but we cannot make
any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Section 5. General Information About Project
Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
This website includes information about Project Gutenberg™,
including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
back
back
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookfinal.com

More Related Content

PDF
Developer s Guide to Microsoft Enterprise Library C Edition Alex Homer
PDF
Developer s Guide to Microsoft Enterprise Library C Edition Alex Homer
PDF
Developer s Guide to Microsoft Enterprise Library C Edition Alex Homer
PDF
Developer s Guide to Microsoft Enterprise Library C Edition Alex Homer
PDF
Mcts Selfpaced Training Kit Exam 70516 Accessing Data With Microsoft Net Fram...
PDF
Developer’s guide to microsoft enterprise library preview
PDF
Database Programming with Visual Basic NET and ADO NET Tips Tutorials and Cod...
PDF
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Developer s Guide to Microsoft Enterprise Library C Edition Alex Homer
Developer s Guide to Microsoft Enterprise Library C Edition Alex Homer
Developer s Guide to Microsoft Enterprise Library C Edition Alex Homer
Developer s Guide to Microsoft Enterprise Library C Edition Alex Homer
Mcts Selfpaced Training Kit Exam 70516 Accessing Data With Microsoft Net Fram...
Developer’s guide to microsoft enterprise library preview
Database Programming with Visual Basic NET and ADO NET Tips Tutorials and Cod...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...

Similar to Developer s Guide to Microsoft Enterprise Library Visual Basic Edition Patterns Practices Alex Homer (20)

PDF
Programming Entity Framework Building Data Centric Apps with the ADO NET Enti...
PDF
Programming Microsoft Sql Server 2000 With Microsoft Visual Basic Net 1st Edi...
PDF
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
PDF
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
PDF
Database Programming With Visual Basic Net And Adonet Tips Tutorials And Code...
PDF
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
PDF
Coherence developer's guide
PDF
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
PPT
Dot net Online Training | .Net Training and Placement online
PDF
Professional Adonet 2 Programming With Sql Server 2005 Oracle And Mysql Walla...
PDF
Entity Framework Tutorial Joydip Kanjilal
PDF
Advanced Programming Using Visual Basic. NET
PDF
WCF Multi Layer Services Development with Entity Framework 4th Edition Editio...
PDF
70487.pdf
PDF
Entity Framework Core Cookbook 2nd Edition Ricardo Peres
PDF
Visual Basic 2008 Programmer s Reference Rod Stephens
DOCX
Framework 4
PPT
Enterprise Library 3.0 Overview
PDF
Programming Visual Basic 2008 Tim Patrick
PPT
c# training | c# training videos | c# object oriented programming | c# course
Programming Entity Framework Building Data Centric Apps with the ADO NET Enti...
Programming Microsoft Sql Server 2000 With Microsoft Visual Basic Net 1st Edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Database Programming With Visual Basic Net And Adonet Tips Tutorials And Code...
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Coherence developer's guide
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edi...
Dot net Online Training | .Net Training and Placement online
Professional Adonet 2 Programming With Sql Server 2005 Oracle And Mysql Walla...
Entity Framework Tutorial Joydip Kanjilal
Advanced Programming Using Visual Basic. NET
WCF Multi Layer Services Development with Entity Framework 4th Edition Editio...
70487.pdf
Entity Framework Core Cookbook 2nd Edition Ricardo Peres
Visual Basic 2008 Programmer s Reference Rod Stephens
Framework 4
Enterprise Library 3.0 Overview
Programming Visual Basic 2008 Tim Patrick
c# training | c# training videos | c# object oriented programming | c# course
Ad

Recently uploaded (20)

PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
Yogi Goddess Pres Conference Studio Updates
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Complications of Minimal Access Surgery at WLH
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
master seminar digital applications in india
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
2.FourierTransform-ShortQuestionswithAnswers.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Yogi Goddess Pres Conference Studio Updates
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Anesthesia in Laparoscopic Surgery in India
Final Presentation General Medicine 03-08-2024.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Complications of Minimal Access Surgery at WLH
human mycosis Human fungal infections are called human mycosis..pptx
master seminar digital applications in india
O5-L3 Freight Transport Ops (International) V1.pdf
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Computing-Curriculum for Schools in Ghana
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Orientation - ARALprogram of Deped to the Parents.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
VCE English Exam - Section C Student Revision Booklet
Ad

Developer s Guide to Microsoft Enterprise Library Visual Basic Edition Patterns Practices Alex Homer

  • 1. Visit ebookfinal.com to download the full version and explore more ebooks or textbooks Developer s Guide to Microsoft Enterprise Library Visual Basic Edition Patterns Practices Alex Homer _____ Click the link below to download _____ https://ebookfinal.com/download/developer-s-guide-to- microsoft-enterprise-library-visual-basic-edition-patterns- practices-alex-homer/ Explore and download more ebooks or textbook at ebookfinal.com
  • 2. Here are some recommended products that we believe you will be interested in. You can click the link to download. NET application architecture guide 2nd ed Edition Microsoft Patterns & Practices Team https://ebookfinal.com/download/net-application-architecture- guide-2nd-ed-edition-microsoft-patterns-practices-team/ Clearly Visual Basic Programming with Microsoft Visual Basic 2010 2nd Edition Diane Zak https://ebookfinal.com/download/clearly-visual-basic-programming-with- microsoft-visual-basic-2010-2nd-edition-diane-zak/ Cocoon Developer s Handbook Developer s Library 1st Edition Lajos Moczar https://ebookfinal.com/download/cocoon-developer-s-handbook-developer- s-library-1st-edition-lajos-moczar/ mod_perl Developer s Cookbook Developer s Library 1st Edition Geoffrey Young https://ebookfinal.com/download/mod_perl-developer-s-cookbook- developer-s-library-1st-edition-geoffrey-young/
  • 3. Mastering Microsoft Visual Basic 2010 1st Edition Evangelos Petroutsos https://ebookfinal.com/download/mastering-microsoft-visual- basic-2010-1st-edition-evangelos-petroutsos/ VSTO for Mere Mortals TM A VBA Developer s Guide to Microsoft Office Development Using Visual Studio 2005 Tools for Office 1st Edition Kathleen Mcgrath https://ebookfinal.com/download/vsto-for-mere-mortals-tm-a-vba- developer-s-guide-to-microsoft-office-development-using-visual- studio-2005-tools-for-office-1st-edition-kathleen-mcgrath/ Microsoft Visual Basic Game Programming for Teens 2nd Edition Jonathan S.(Jonathan S. Harbour) Harbour https://ebookfinal.com/download/microsoft-visual-basic-game- programming-for-teens-2nd-edition-jonathan-s-jonathan-s-harbour- harbour/ Microsoft Visual Basic NET Programming for the Absolute Beginner 1st Edition Jonathan S. Harbour https://ebookfinal.com/download/microsoft-visual-basic-net- programming-for-the-absolute-beginner-1st-edition-jonathan-s-harbour/ Visual Writing Alex Baratta https://ebookfinal.com/download/visual-writing-alex-baratta/
  • 5. Developer s Guide to Microsoft Enterprise Library Visual Basic Edition Patterns Practices Alex Homer Digital Instant Download Author(s): Alex Homer, Nicolas Botto, Bob Brumfield, Grigori Melnik, Erik Renaud, Fernando Simonazzi, Chris Tavares ISBN(s): 9780735651777, 0735651779 Edition: 1 File Details: PDF, 3.70 MB Year: 2010 Language: english
  • 6. D E V E LO P E R ’ S GU I D E TO M I C R O S O F T ® EN T E R P R I S E LI B R A RY Alex Homer with Nicolas Botto Bob Brumfield Olaf Conijn Grigori Melnik Erik Renaud Fernando Simonazzi Chris Tavares Solutions for Enterprise Development Visual Basic Edition
  • 7. developer’s guide to microsoft® enterprise library D ownload from Wow! eBook <www.wowebook.com>
  • 9. developer’s guide to Microsoft® Enterprise Library Solutions for Enterprise Development Alex Homer with Nicolas Botto Bob Brumfield Olaf Conijn Grigori Melnik Erik Renaud Fernando Simonazzi Chris Tavares
  • 10. Copyright and Terms of Use ISBN: 9780735651777 This document is provided “as-is.” Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it. Some examples depicted herein are provided for illustration only and are fictitious. No real association or connection is intended or should be inferred. This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. © 2010 Microsoft. All rights reserved. Microsoft, Windows, Windows Server, Windows Vista, Visual C#, SQL Server, Active Directory, IntelliSense, Silverlight, MSDN, Internet Explorer, and Visual Studio are trademarks of the Microsoft group of companies. All other trademarks are property of their respective owners.
  • 11. Contents preface xv About This Guide xv What Does This Guide Cover? xv What This Guide Does Not Cover xvi How Will This Guide Help You? xvii What Do You Need to Get Started? xvii the team who brought you this guide xix The Enterprise Library 5.0 Development Team xix 1 Welcome to the Library 1 Meet the Librarian 1 What You Get with Enterprise Library 1 Things You Can Do with Enterprise Library 3 Why You Should Use Enterprise Library 4 Some Fundamentals of Enterprise Library 6 Choosing Which Blocks To Install 6 Installing Enterprise Library 7 Assemblies And References 7 GAC or Bin, Signed or Unsigned? 8 Importing Namespaces 9 Configuring Enterprise Library 10 The Configuration Tools 10 Using The Configuration Tools 11 Encrypting Configuration Sections 14 Instantiating and Using Enterprise Library Objects 14 Enterprise Library Objects, Facades, and Factories 15 foreword Scott Guthrie xiii
  • 12. Creating Instances of Enterprise Library Types 15 The Simple Approach — Using The Enterprise Library Service Locator 16 The Sophisticated Approach — Accessing The Container Directly 16 Pros and Cons of Object Instantiation 18 More Reasons to be Sophisticated 19 Getting Objects From Previous Versions Of Enterprise Library 21 The Example Applications 22 Summary 23 2 Much ADO about Data Access 25 Introduction 25 What Does the Data Access Application Block Do? 26 Data Operations Supported by the Data Access Block 26 How Do I Use the Data Access Block? 28 Configuring the Block and Referencing the Required Assemblies 28 Creating Database Instances 29 The Example Application 30 Reading Multiple Data Rows 31 Reading Rows Using a Query with No Parameters 31 Reading Rows Using an Array of Parameter Values 32 Reading Rows Using Queries with Named Parameters 33 Retrieving Data as Objects 35 About Accessors 35 Creating and Executing an Accessor 37 Creating and Using Mappers 38 Retrieving Xml Data 39 Retrieving Single Scalar Values 40 Retrieving Data Asynchronously 41 Preparing for Asynchronous Data Access 42 Retrieving Row Set Data Asynchronously 43 Retrieving Data as Objects Asynchronously 45 Updating Data 45 Executing an Update Query 46 Working with DataSets 47 Updating the Database from a DataSet 48 Managing Connections 52 Working with Connection-Based Transactions 53 Working with Distributed Transactions 55 Extending the Block to Use Other Databases 58 Summary 58
  • 13. 3 Error Management Made Exceptionally Easy 61 Introduction 61 When Should I Use the Exception Handling Block? 62 How Do I Use the Exception Handling Block? 62 What Exception Policies Do I Need? 63 Allowing Exceptions to Propagate 63 About Exception Handling Policies 63 Choosing an Exception Handling Strategy 65 Process or Handle Exception? 66 Using the Process Method 67 Diving in with a Simple Example 68 Applying Exception Shielding 69 Wrapping an Exception 70 Configuring the Wrap Handler Policy 70 Initializing the Exception Handling Block 71 Editing the Application Code to Use the New Policy 71 Replacing an Exception 74 Logging an Exception 75 Shielding Exceptions at WCF Service Boundaries 78 Creating a Fault Contract 78 Configuring the Exception Handling Policy 78 Editing the Service Code to Use the New Policy 79 The Fault Contract Exception Handler 80 Handling Specific Exception Types 82 Executing Code around Exception Handling 83 Assisting Administrators 85 Extending Your Exception Handling 87 Summary 87 4 As Easy as Falling Off a Log 89 Introduction 89 What Does the Logging Block Do? 90 Logging Categories 92 Logging Overhead and Additional Context Information 93 How Do I Use the Logging Block? 93 Configuring the Logging Block 93 Initializing the Logging Block 94 Diving In with an Example 95 Creating and Writing Log Entries with a Logwriter 95 About Logging Categories 98 Filtering by Category 100 Writing Log Entries to Multiple Categories 100 Controlling Output Formatting 101
  • 14. Non-Formatted Trace Listeners 102 Filtering by Severity in a Trace Listener 103 Filtering All Log Entries by Priority 103 Creating and Using Logentry Objects 104 Capturing Unprocessed Events and Logging Errors 105 About Special Sources 105 An Example of Using Special Sources 106 Logging to a Database 108 Using the Database Trace Listener 109 Testing Logging Filter Status 110 Obtaining Information about Trace Sources and Trace Listeners 111 Checking if Filters Will Block a Log Entry 112 Adding Additional Context Information 114 Tracing and Correlating Activities 115 An Example of Tracing Activities 116 Creating Custom Trace Listeners, Filters, and Formatters 119 Summary 119 5 A Cache Advance for Your Applications 121 Introduction 121 What Does the Caching Block Do? 123 Flushed or Expired? 123 Which Expiration Policy? 124 How Do I Configure the Caching Block? 124 Persistent Caching 125 Encrypting Cached Items 126 Initializing the Caching Block 126 How Do I Use the Caching Block? 127 About the Example Application 127 Adding Items to and Retrieving Items from the Cache 127 What’s In My Cache? 130 Using the Isolated Storage Backing Store 131 Encrypting the Cached Data 133 Using the Database Backing Store 134 Removing Items From and Flushing the Cache 135 Using a File Dependency and Extended Time Expiration 136 Adding the Items to the Cache 137 Refreshing the Cache 139 Loading the Cache 141 Proactive Cache Loading 141 Reactive Cache Loading 142 Extending Your Cache Advance 143 Summary 144 D ownload from Wow! eBook <www.wowebook.com>
  • 15. 6 Banishing Validation Complication 145 Introduction 145 Techniques for Validation 146 Where Should I Validate? 146 What Should I Validate? 146 How Should I Validate? 147 What Does the Validation Block Do? 147 The Range of Validators 149 Validating with Attributes 151 DataAnnotations Attributes 151 Self-Validation 152 Validation Rule Sets 154 Assigning Validation Rules to Rule Sets 154 Configuring Validation Block Rule Sets 154 Specifying Rule Sets When Validating 155 How Do I Use The Validation Block? 156 Preparing Your Application 156 Choosing a Validation Approach 157 Options for Creating Validators Programmatically 158 Performing Validation and Displaying Validation Errors 159 Understanding Message Template Tokens 160 Diving in With Some Simple Examples 161 Validating Objects and Collections of Objects 162 Creating a Type Validator using the ValidatorFactory 162 Delving Deeper into ValidationResults 163 Using the Object Validator 164 Differences Between the Object Validator and the Factory-Created Type Validators 164 Validating Collections of Objects 165 Using Validation Attributes 166 Using the Validation Block Attributes 166 Using Data Annotation Attributes 169 Defining Attributes in Metadata Classes 171 Specifying the Location of Validation Rules 172 Creating and Using Individual Validators 173 Validating Strings for Contained Characters 173 Validating Integers within a Domain 173 Validating with a Composite Validator 174 Validating Single Members of an Object 174 WCF Service Validation Integration 176 Defining Validation in the Service Contract 176 Editing the Service Configuration 177 Using the Product Service and Detecting Validation Errors 178 User Interface Validation Integration 180 ASP.NET User Interface Validation 180
  • 16. Windows Forms User Interface Validation 181 WPF User Interface Validation 181 Creating Custom Validators 182 Summary 182 7 Relieving Cryptography Complexity 183 Introduction 183 What Does the Cryptography Block Do? 183 A Secret Shared 184 Making a Hash of It 184 How Does the Cryptography Block Manage Encryption Keys? 184 How Does the Cryptography Block Integrate With Other Blocks? 185 How Do I Use the Cryptography Block? 185 Configuring Cryptographic Providers 186 Adding the Required References 187 Diving in with an Example 187 Encrypting and Decrypting Data Using A Symmetric Provider 188 Encrypting and Decrypting a Text String 188 Encrypting and Decrypting an Object Instance 189 Obtaining and Comparing Hash Values 191 Creating and Comparing Hash Values for Text Strings 191 Creating and Comparing Hash Values for Object Instances 193 Creating Custom Cryptography Providers 195 Summary 196 8 An Authentic Approach to Token Identity 197 Introduction 197 What Does the Security Block Do? 198 What are Authorization Rule Providers? 198 About Authorization Manager (AzMan) 198 Why Do I Need a Security Cache? 199 How Do I Configure the Security Block? 200 Configuring Authorization Rules 202 How Do I Use the Security Block? 202 Diving in With an Example 203 Caching a User Identity and Obtaining A Temporary Token 204 Displaying User Identity Details 205 Displaying Generic Principal Details 205 Authenticating a User Using a Token 206
  • 17. Terminating a User Session and Expiring the Token 207 Checking If a User is Authorized to Perform a Task 208 Using Security Block Configured Rules 208 Using AzMan Provider Rules 210 Creating Custom Authorization Providers 212 Summary 212 appendices a dependency injection with unity 213 What is Dependency Injection? 213 The Unity Dependency Injection and Interception Mechanism 214 Summary of Unity Features 215 Defining Dependencies with Unity 216 Constructor Injection 217 Automatic Constructor Injection 217 Design-Time Configuration 218 Run-Time Configuration 219 Configuration with Attributes 219 Property (Setter) Injection 220 Design-Time Configuration 220 Run-Time Configuration 221 Configuration with Attributes 221 Method Call Injection 222 Design-Time Configuration 223 Run-Time Configuration 223 Configuration with Attributes 223 More Dependency Injection Opportunities 224 Resolving Populated Instances of Your Classes 224 b dependency injection in enterprise library 227 Loading Configuration Information into a Unity Container 227 Viewing Registrations in the Container 228 Populating Entire Object Graphs at Application Startup 229 Maintaining a Container Reference in Request-Based Applications 230 Using an Alternative Service Locator or Container 231 c policy injection in enterprise library 233 d enterprise library configuration scenarios 235 About Enterprise Library Configuration 235 External Configuration 236 Programmatic Support 236 Using the Fluent Interfaces 236
  • 18. Scenarios for Advanced Configuration 237 scenario 1: Using The Default Application Configuration File 237 scenario 2: Using A Non-Default Configuration Store 237 scenario 3: Sharing The Same Configuration Between Multiple Applications 238 scenario 4: Managing And Enforcing Configuration For Multiple Applications 238 scenario 5: Sharing Configuration Sections Across Multiple Applications 239 scenario 6: Applying a Common Configuration Structure for Applications 240 Deployment Environments 241 e encrypting configuration files 243 index 245
  • 19. xiii Foreword You are holding in your hands a book that will make your life as an enterprise developer a whole lot easier. It’s a guide on Microsoft Enterprise Library and it’s meant to guide you through how to apply .NET for enterprise development. Enterprise Library, developed by the patterns & practices group, is a collection of reusable components, each addressing a specific cross cutting concern—be it system logging, or data validation, or exception management. Many of these can be taken advantage of easily. These components are architecture agnostic and can be applied in a multitude of different contexts. The book walks you through functional blocks of the Enterprise Library, which include data access, caching, cryptography, exception handling, logging, security, and validation. It contains a large collection of exercises, tricks and tips. Developing robust, reusable, and maintainable application requires knowledge of design patterns, software architectures and solid coding skills. We can help you develop those skills with Enterprise Library since it encapsulates proven and recommended prac- tices of developing enterprise applications on the .NET platform. Though this guide does not go into the depth of discussions of architecture and patterns, it provides a solid basis for you to discover and implement these patterns from a reusable set of components. That’s why I also encourage you to check out the Enterprise Library source code and read it. This guide is not meant to be a complete reference on Enterprise Library. For that, you should go to MSDN. Instead, the guide covers most commonly used scenarios and illustrates how Enterprise Library can be applied in implementing those. The powerful message manifesting from the guide is the importance of code reuse. In today’s world of complex large software systems, high-quality pluggable components are a must. After all, who can afford to write and then maintain dozens of different frameworks in a system— all to accomplish the same thing? Enterprise Library allows you to take advantage of the proven code complements to manage a wide range of task and leaves you free to concen- trate on the core business logic and other “working parts” of your application. Another important emphasis that the guide makes is on software designs, which are easy to configure, testable and maintainable. Enterprise Library has a flexible configura- tion subsystem driven from either external config files, or programmatically, or both. Leading by example, Enterprise Library itself is designed in a loosely-coupled manner. It
  • 20. promotes key design principles of the separation of concerns, single responsibility prin- ciple, principle of least knowledge and the DRY principle (Don’t Repeat Yourself). Having said this, don’t expect this particular guide to be a comprehensive reference on design patterns. It is not. It provides just enough to demonstrate how key patterns are used with Enterprise Library. Once you see and understand them, try to extrapolate them to other problems, contexts, scenarios. The authors succeeded in writing a book that is targeted at both those who are sea- soned Enterprise Library developers and who would like to learn about the improvements in version 5.0, and those, who are brand new to Enterprise Library. Hopefully, for the first group, it will help orientate you and also get a quick refresher of some of the key concepts. For the second group, the book may lower your learning curve and get you going with Enterprise Library quickly. Lastly, don’t just read this book. It is meant to be a practical tutorial. And learning comes only through practice. Experience Enterprise Library. Build something with it. Apply the concepts learnt in practice. And don’t forget to share your experience. In conclusion, I am excited about both the release of Enterprise Library 5.0 and this book. Especially, since they ship and support some of our great new releases—Visual Studio 2010, .NET Framework 4.0 and Silverlight 4, which together will make you, the developer, ever more productive. Scott Guthrie Corporate Vice-President Microsoft .NET Developer Platform Redmond, Washington D ownload from Wow! eBook <www.wowebook.com>
  • 21. xv Preface About This Guide When you casually pick up a book in your local bookstore or select one from the endless collection available on your favorite Web site, you’re probably wondering what the book actually covers, what you’ll learn from it, whether the content is likely to be interesting and useful, and—of course—whether it is actually any good. We’ll have a go at answering the first three of these questions here. The final question is one only you can answer. Of course, we would be pleased to hear your opinion through our community Web site at http://entlib.codeplex.com/. what does this guide cover? As you can probably tell from the title, this guide concentrates on how you can get started with Enterprise Library. It will help you learn how to use Enterprise Library in your applications to manage your crosscutting concerns, simplify and accelerate your develop- ment cycle, and take advantage of proven practices. Enterprise Library is a collection of prewritten code components that have been developed and fine-tuned over many years. You can use them out of the box, modify them as required, and distribute them with your applications. You can even use Enterprise Library as a learning resource. It includes the source code that demonstrates Microsoft®.NET programming techniques and the use of common design patterns that can improve the design and maintainability of your applica- tions. By the way, if you are not familiar with the term crosscutting concerns, don’t worry; we’ll explain it as we go along. Enterprise Library is an extensive collection, with a great many moving parts. To the beginner knowing how to best take advantage of it is not completely intuitive. Therefore, in this guide we’ll help you to quickly understand what Enterprise Library is, what it contains, how you can select and use just the specific features you require, and how easy it is to get started using them. You will see how you can quickly and simply add Enterprise Library to your applications, configure it to do exactly what you need, and then benefit from the simple-to-use, yet extremely compelling opportunities it provides for writing less code that achieves more. The first chapter of this guide discusses Enterprise Library in general, and provides details of the individual parts so that you become familiar with the framework as a whole.
  • 22. xvi The aim is for you to understand the basic principles of each of the application blocks in Enterprise Library, and how you can choose exactly which blocks and features you re- quire. Chapter 1 also discusses the fundamentals of using the blocks, such as how to configure them, how to instantiate the components, and how to use these components in your code. The remaining seven chapters discuss in detail the application blocks that provide the basic crosscutting functionality such as data access, caching, logging, and exception han- dling. These chapters explain the concepts that drove development of the blocks, the kinds of tasks they can accomplish, and how they help you implement many well-known design patterns. And, of course, they explain—by way of code extracts and sample pro- grams—how you actually use the blocks in your applications. After you’ve read each chapter, you should be familiar with the block and be able to use it to perform a range of functions quickly and easily, in both new and existing applications. Finally, the appendices present more detailed information on specific topics that you don’t need to know about in detail to use Enterprise Library, but are useful as additional resources and will help you understand how features such as dependency injection, inter- ception, and encryption fit into the Enterprise Library world. You can also download and work through the Hands-On Labs for Enterprise Library, which are available at http://go.microsoft.com/fwlink/?LinkId=188936. what this guide does not cover The aim of this guide is to help you learn how to benefit from the capabilities of Enter- prise Library. It does not describe the common design patterns in depth, or attempt to teach you about application architecture in general. Instead, it concentrates on getting you up to speed quickly and with minimum fuss so you can use Enterprise Library to manage your crosscutting concerns. One of the core tenets of modern application design is that you should reduce the coupling or dependencies between components and objects, and Enterprise Library ver- sion 5.0 helps you achieve this goal through use of the Dependency Injection (DI) design pattern. However, you do not have to be a DI expert to use Enterprise Library; all of the complexity is managed internally by the core mechanisms within the framework. While we do explain the basic use of DI in terms of Enterprise Library, that is not a fundamental feature of this guide. Enterprise Library is designed to be extensible. You can extend it simply by writing custom plug-in providers, by modifying the core code of the library, or even by creating entirely new blocks. In this guide, we provide pointers to how you can do this and explain the kinds of providers that you may be tempted to create, but it is not a topic that we cover in depth. These topics are discussed more fully in the documentation installed with Enterprise Library and available online at http://go.microsoft.com/fwlink/?LinkId=188874, and in the many other resources available from our community Web site at http://www. codeplex.com/entlib. For more information about the Dependency Injection (DI) design pattern and the associated patterns, see “Inversion of Control Containers and the Dependency Injection pattern” at http://martinfowler.com/articles/injection.html.
  • 23. xvii how will this guide help you? If you build applications that run on the Microsoft .NET Framework, whether they are enterprise-level business applications or even relatively modest Windows® Forms, Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), or ASP.NET applications, you can benefit from Enterprise Library. This guide helps you to quickly grasp what Enterprise Library can do for you, presents examples that show it in action, and make it easier for you to start experimenting with Enterprise Library. The sample applications are easy to assimilate, fully commented, and contain code that demonstrates all of the main features. You can copy this code directly into your applications if you wish, or just use it as a guide when you need to implement the common functionality it provides. The samples are console-based applications that contain sepa- rate procedures for each function they demonstrate. You can download these samples from http://go.microsoft.com/fwlink/?LinkId=189009. Finally, what is perhaps the most important feature of this guide is that it will hope- fully allay any fears you may have about using other people’s code in your applications. By understanding how to select exactly the features you need, and installing the minimum requirements to implement these features, you will see that what might seem like a huge and complicated framework is actually a really useful set of individual components and features from which you can pick and choose—a candy store for the architect and developer. What Do You Need to Get Started? The prerequisites for using this guide are relatively simple. You’ll need to be relatively experienced in Visual Basic, and understand general object-oriented programming tech- niques. The system requirements and prerequisites for using Enterprise Library are: • Supported architectures: x86 and x64. • Operating system: Microsoft Windows® 7 Professional, Enterprise, or Ultimate; Windows Server® 2003 R2; Windows Server 2008 with Service Pack 2; Win- dows Server 2008 R2; Windows Vista® with Service Pack 2; or Windows XP with Service Pack 3. • Microsoft .NET Framework 3.5 with Service Pack 1 or Microsoft .NET Framework 4.0. • For a rich development environment, the following are recommended: • Microsoft Visual Studio® 2008 Development System with Service Pack 1 (any edition) or Microsoft Visual Studio 2010 Development System (any edition). • To run the unit tests, the following are also required: • Microsoft Visual Studio 2008 Professional, Visual Studio 2008 Team Edition, Visual Studio 2010 Premium, Visual Studio 2010 Professional, or Visual Studio 2010 Ultimate Edition. • Moq v3.1 assemblies.
  • 24. xviii • For the Data Access Application Block, the following is also required: • A database server running a database that is supported by a .NET Framework 3.5 with Service Pack 1 or .NET Framework 4.0 data provider. This includes Microsoft SQL Server® 2000 or later, SQL Server 2005 Compact Edition, and Oracle 9i or later. The database server can also run a database that is supported by the .NET Framework 3.5 with Service Pack 1 or the .NET Framework 4.0 data providers for OLE DB or ODBC. • For the Logging Application Block, the following are also required: • Stores to maintain log messages. If you are using the MSMQ trace listener to store log messages, you need the Microsoft Message Queuing (MSMQ) component installed. If you are using the Database trace listener to store log messages, you need access to a database server. If you are using the Email trace listener to store log messages, you need access to an SMTP server. Other than that, all you require is some spare time to sit and read, and to play with the example programs. Hopefully you will find the contents interesting (and perhaps even entertaining), as well as a useful source for learning about Enterprise Library.
  • 25. xix Idea/Vision Grigori Melnik Main Author Alex Homer Contributing Authors Nicolas Botto, Bob Brumfield, Olaf Conijn, Grigori Melnik, Erik Renaud, Fernando Simonazzi, and Chris Tavares. Reviewers Scott Densmore, Tom Hollander, Hernan de Lahitte, Ajoy Krishnamoorthy, Ade Miller, and Don Smith. Graphic Artists Patrick Lanfear and Tom Draper. Editors RoAnn Corbisier and Nancy Michell. the enterprise library 5.0 development team Product/Program Management Grigori Melnik (Microsoft Corporation). Architecture/ Development Bob Brumfield and Chris Tavares (Microsoft Corporation); Fernando Simonazzi (Clarius Consulting); Nicolas Botto (Digit Factory); and Olaf Conijn (Olaf Conijn BV). Testing Carlos Farre, Masashi Narumoto, and Rohit Sharma (Microsoft Corporation); Nicolas Botto (Digit Factory); Lavanya Selvaraj, Magdelene Sona, Mani Krishnaswami, Meenakshi Krishnamoorthi, Santhosh Panneerselvam, and Ravindra Varman (Infosys Technologies Ltd); Erik Renaud and François Tanguay (nVentive Inc); and Rick Carr (DCB Software Testing, Inc). User Experience Damon van Vessem, Heidi Adkisson, Jen Amsterlaw, and Kelly Franznick (Blink Interactive); and Brad Cunningham (Interknowlodgy). Documentation Alex Homer (Microsoft Corporation) and Dennis DeWitt (Linda Werner &Associates Inc). the team who brought you this guide
  • 26. Discovering Diverse Content Through Random Scribd Documents
  • 27. (Larger) CHRISTMAS SUPPLEMENT TO Harper’s Weekly (BLUE BEARD RED RIDING HOOD TOM THUMB SANTA CLAUS
  • 28. PUSS IN BOOTS. PEACE ON EARTH AND GOOD WILL TOWARD MEN! CINDERELLA.)
  • 30. (Larger) “Merry Christmas to all, and to all a good-night.”
  • 31. (Larger) “Wishing you a Merry Christmas and a Happy New Year.”
  • 32. (Larger) ’TWAS THE NIGHT AFTER CHRISTMAS.
  • 33. Transcriber’s Notes Punctuation, hyphenation, and spelling were made consistent when a predominant preference was found in the original book; otherwise they were not changed. Simple typographical errors were corrected; unbalanced quotation marks were remedied when the change was obvious, and otherwise left unbalanced. This book does not have page numbers. Transcriber added sequence numbers to the entries in the Table of Contents. When illustrations did not have captions, Transcriber added them by using part of the corresponding entry in the Table of Contents, or text within the illustrations themselves. Transcriber added words and phrases that were within some of the illustrations to their captions, and enclosed them in parentheses to indicate they were not parts of the original captions. The first illustration is the cover. The original book was autographed. A copy of that is included in this eBook as the second illustration.
  • 34. *** END OF THE PROJECT GUTENBERG EBOOK THOMAS NAST'S CHRISTMAS DRAWINGS FOR THE HUMAN RACE *** Updated editions will replace the previous one—the old editions will be renamed. Creating the works from print editions not protected by U.S. copyright law means that no one owns a United States copyright in these works, so the Foundation (and you!) can copy and distribute it in the United States without permission and without paying copyright royalties. Special rules, set forth in the General Terms of Use part of this license, apply to copying and distributing Project Gutenberg™ electronic works to protect the PROJECT GUTENBERG™ concept and trademark. Project Gutenberg is a registered trademark, and may not be used if you charge for an eBook, except by following the terms of the trademark license, including paying royalties for use of the Project Gutenberg trademark. If you do not charge anything for copies of this eBook, complying with the trademark license is very easy. You may use this eBook for nearly any purpose such as creation of derivative works, reports, performances and research. Project Gutenberg eBooks may be modified and printed and given away—you may do practically ANYTHING in the United States with eBooks not protected by U.S. copyright law. Redistribution is subject to the trademark license, especially commercial redistribution. START: FULL LICENSE
  • 35. THE FULL PROJECT GUTENBERG LICENSE
  • 36. PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK To protect the Project Gutenberg™ mission of promoting the free distribution of electronic works, by using or distributing this work (or any other work associated in any way with the phrase “Project Gutenberg”), you agree to comply with all the terms of the Full Project Gutenberg™ License available with this file or online at www.gutenberg.org/license. Section 1. General Terms of Use and Redistributing Project Gutenberg™ electronic works 1.A. By reading or using any part of this Project Gutenberg™ electronic work, you indicate that you have read, understand, agree to and accept all the terms of this license and intellectual property (trademark/copyright) agreement. If you do not agree to abide by all the terms of this agreement, you must cease using and return or destroy all copies of Project Gutenberg™ electronic works in your possession. If you paid a fee for obtaining a copy of or access to a Project Gutenberg™ electronic work and you do not agree to be bound by the terms of this agreement, you may obtain a refund from the person or entity to whom you paid the fee as set forth in paragraph 1.E.8. 1.B. “Project Gutenberg” is a registered trademark. It may only be used on or associated in any way with an electronic work by people who agree to be bound by the terms of this agreement. There are a few things that you can do with most Project Gutenberg™ electronic works even without complying with the full terms of this agreement. See paragraph 1.C below. There are a lot of things you can do with Project Gutenberg™ electronic works if you follow the terms of this agreement and help preserve free future access to Project Gutenberg™ electronic works. See paragraph 1.E below.
  • 37. 1.C. The Project Gutenberg Literary Archive Foundation (“the Foundation” or PGLAF), owns a compilation copyright in the collection of Project Gutenberg™ electronic works. Nearly all the individual works in the collection are in the public domain in the United States. If an individual work is unprotected by copyright law in the United States and you are located in the United States, we do not claim a right to prevent you from copying, distributing, performing, displaying or creating derivative works based on the work as long as all references to Project Gutenberg are removed. Of course, we hope that you will support the Project Gutenberg™ mission of promoting free access to electronic works by freely sharing Project Gutenberg™ works in compliance with the terms of this agreement for keeping the Project Gutenberg™ name associated with the work. You can easily comply with the terms of this agreement by keeping this work in the same format with its attached full Project Gutenberg™ License when you share it without charge with others. 1.D. The copyright laws of the place where you are located also govern what you can do with this work. Copyright laws in most countries are in a constant state of change. If you are outside the United States, check the laws of your country in addition to the terms of this agreement before downloading, copying, displaying, performing, distributing or creating derivative works based on this work or any other Project Gutenberg™ work. The Foundation makes no representations concerning the copyright status of any work in any country other than the United States. 1.E. Unless you have removed all references to Project Gutenberg: 1.E.1. The following sentence, with active links to, or other immediate access to, the full Project Gutenberg™ License must appear prominently whenever any copy of a Project Gutenberg™ work (any work on which the phrase “Project Gutenberg” appears, or with which the phrase “Project Gutenberg” is associated) is accessed, displayed, performed, viewed, copied or distributed:
  • 38. This eBook is for the use of anyone anywhere in the United States and most other parts of the world at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.org. If you are not located in the United States, you will have to check the laws of the country where you are located before using this eBook. 1.E.2. If an individual Project Gutenberg™ electronic work is derived from texts not protected by U.S. copyright law (does not contain a notice indicating that it is posted with permission of the copyright holder), the work can be copied and distributed to anyone in the United States without paying any fees or charges. If you are redistributing or providing access to a work with the phrase “Project Gutenberg” associated with or appearing on the work, you must comply either with the requirements of paragraphs 1.E.1 through 1.E.7 or obtain permission for the use of the work and the Project Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9. 1.E.3. If an individual Project Gutenberg™ electronic work is posted with the permission of the copyright holder, your use and distribution must comply with both paragraphs 1.E.1 through 1.E.7 and any additional terms imposed by the copyright holder. Additional terms will be linked to the Project Gutenberg™ License for all works posted with the permission of the copyright holder found at the beginning of this work. 1.E.4. Do not unlink or detach or remove the full Project Gutenberg™ License terms from this work, or any files containing a part of this work or any other work associated with Project Gutenberg™. 1.E.5. Do not copy, display, perform, distribute or redistribute this electronic work, or any part of this electronic work, without prominently displaying the sentence set forth in paragraph 1.E.1 with active links or immediate access to the full terms of the Project Gutenberg™ License.
  • 39. 1.E.6. You may convert to and distribute this work in any binary, compressed, marked up, nonproprietary or proprietary form, including any word processing or hypertext form. However, if you provide access to or distribute copies of a Project Gutenberg™ work in a format other than “Plain Vanilla ASCII” or other format used in the official version posted on the official Project Gutenberg™ website (www.gutenberg.org), you must, at no additional cost, fee or expense to the user, provide a copy, a means of exporting a copy, or a means of obtaining a copy upon request, of the work in its original “Plain Vanilla ASCII” or other form. Any alternate format must include the full Project Gutenberg™ License as specified in paragraph 1.E.1. 1.E.7. Do not charge a fee for access to, viewing, displaying, performing, copying or distributing any Project Gutenberg™ works unless you comply with paragraph 1.E.8 or 1.E.9. 1.E.8. You may charge a reasonable fee for copies of or providing access to or distributing Project Gutenberg™ electronic works provided that: • You pay a royalty fee of 20% of the gross profits you derive from the use of Project Gutenberg™ works calculated using the method you already use to calculate your applicable taxes. The fee is owed to the owner of the Project Gutenberg™ trademark, but he has agreed to donate royalties under this paragraph to the Project Gutenberg Literary Archive Foundation. Royalty payments must be paid within 60 days following each date on which you prepare (or are legally required to prepare) your periodic tax returns. Royalty payments should be clearly marked as such and sent to the Project Gutenberg Literary Archive Foundation at the address specified in Section 4, “Information about donations to the Project Gutenberg Literary Archive Foundation.” • You provide a full refund of any money paid by a user who notifies you in writing (or by e-mail) within 30 days of receipt that s/he does not agree to the terms of the full Project Gutenberg™ License. You must require such a user to return or destroy all
  • 40. copies of the works possessed in a physical medium and discontinue all use of and all access to other copies of Project Gutenberg™ works. • You provide, in accordance with paragraph 1.F.3, a full refund of any money paid for a work or a replacement copy, if a defect in the electronic work is discovered and reported to you within 90 days of receipt of the work. • You comply with all other terms of this agreement for free distribution of Project Gutenberg™ works. 1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™ electronic work or group of works on different terms than are set forth in this agreement, you must obtain permission in writing from the Project Gutenberg Literary Archive Foundation, the manager of the Project Gutenberg™ trademark. Contact the Foundation as set forth in Section 3 below. 1.F. 1.F.1. Project Gutenberg volunteers and employees expend considerable effort to identify, do copyright research on, transcribe and proofread works not protected by U.S. copyright law in creating the Project Gutenberg™ collection. Despite these efforts, Project Gutenberg™ electronic works, and the medium on which they may be stored, may contain “Defects,” such as, but not limited to, incomplete, inaccurate or corrupt data, transcription errors, a copyright or other intellectual property infringement, a defective or damaged disk or other medium, a computer virus, or computer codes that damage or cannot be read by your equipment. 1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the “Right of Replacement or Refund” described in paragraph 1.F.3, the Project Gutenberg Literary Archive Foundation, the owner of the Project Gutenberg™ trademark, and any other party distributing a Project Gutenberg™ electronic work under this agreement, disclaim all liability to you for damages, costs and
  • 41. expenses, including legal fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE. 1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a defect in this electronic work within 90 days of receiving it, you can receive a refund of the money (if any) you paid for it by sending a written explanation to the person you received the work from. If you received the work on a physical medium, you must return the medium with your written explanation. The person or entity that provided you with the defective work may elect to provide a replacement copy in lieu of a refund. If you received the work electronically, the person or entity providing it to you may choose to give you a second opportunity to receive the work electronically in lieu of a refund. If the second copy is also defective, you may demand a refund in writing without further opportunities to fix the problem. 1.F.4. Except for the limited right of replacement or refund set forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PURPOSE. 1.F.5. Some states do not allow disclaimers of certain implied warranties or the exclusion or limitation of certain types of damages. If any disclaimer or limitation set forth in this agreement violates the law of the state applicable to this agreement, the agreement shall be interpreted to make the maximum disclaimer or limitation permitted by the applicable state law. The invalidity or unenforceability of any provision of this agreement shall not void the remaining provisions.
  • 42. 1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the trademark owner, any agent or employee of the Foundation, anyone providing copies of Project Gutenberg™ electronic works in accordance with this agreement, and any volunteers associated with the production, promotion and distribution of Project Gutenberg™ electronic works, harmless from all liability, costs and expenses, including legal fees, that arise directly or indirectly from any of the following which you do or cause to occur: (a) distribution of this or any Project Gutenberg™ work, (b) alteration, modification, or additions or deletions to any Project Gutenberg™ work, and (c) any Defect you cause. Section 2. Information about the Mission of Project Gutenberg™ Project Gutenberg™ is synonymous with the free distribution of electronic works in formats readable by the widest variety of computers including obsolete, old, middle-aged and new computers. It exists because of the efforts of hundreds of volunteers and donations from people in all walks of life. Volunteers and financial support to provide volunteers with the assistance they need are critical to reaching Project Gutenberg™’s goals and ensuring that the Project Gutenberg™ collection will remain freely available for generations to come. In 2001, the Project Gutenberg Literary Archive Foundation was created to provide a secure and permanent future for Project Gutenberg™ and future generations. To learn more about the Project Gutenberg Literary Archive Foundation and how your efforts and donations can help, see Sections 3 and 4 and the Foundation information page at www.gutenberg.org. Section 3. Information about the Project Gutenberg Literary Archive Foundation
  • 43. The Project Gutenberg Literary Archive Foundation is a non-profit 501(c)(3) educational corporation organized under the laws of the state of Mississippi and granted tax exempt status by the Internal Revenue Service. The Foundation’s EIN or federal tax identification number is 64-6221541. Contributions to the Project Gutenberg Literary Archive Foundation are tax deductible to the full extent permitted by U.S. federal laws and your state’s laws. The Foundation’s business office is located at 809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up to date contact information can be found at the Foundation’s website and official page at www.gutenberg.org/contact Section 4. Information about Donations to the Project Gutenberg Literary Archive Foundation Project Gutenberg™ depends upon and cannot survive without widespread public support and donations to carry out its mission of increasing the number of public domain and licensed works that can be freely distributed in machine-readable form accessible by the widest array of equipment including outdated equipment. Many small donations ($1 to $5,000) are particularly important to maintaining tax exempt status with the IRS. The Foundation is committed to complying with the laws regulating charities and charitable donations in all 50 states of the United States. Compliance requirements are not uniform and it takes a considerable effort, much paperwork and many fees to meet and keep up with these requirements. We do not solicit donations in locations where we have not received written confirmation of compliance. To SEND DONATIONS or determine the status of compliance for any particular state visit www.gutenberg.org/donate. While we cannot and do not solicit contributions from states where we have not met the solicitation requirements, we know of no
  • 44. prohibition against accepting unsolicited donations from donors in such states who approach us with offers to donate. International donations are gratefully accepted, but we cannot make any statements concerning tax treatment of donations received from outside the United States. U.S. laws alone swamp our small staff. Please check the Project Gutenberg web pages for current donation methods and addresses. Donations are accepted in a number of other ways including checks, online payments and credit card donations. To donate, please visit: www.gutenberg.org/donate. Section 5. General Information About Project Gutenberg™ electronic works Professor Michael S. Hart was the originator of the Project Gutenberg™ concept of a library of electronic works that could be freely shared with anyone. For forty years, he produced and distributed Project Gutenberg™ eBooks with only a loose network of volunteer support. Project Gutenberg™ eBooks are often created from several printed editions, all of which are confirmed as not protected by copyright in the U.S. unless a copyright notice is included. Thus, we do not necessarily keep eBooks in compliance with any particular paper edition. Most people start at our website which has the main PG search facility: www.gutenberg.org. This website includes information about Project Gutenberg™, including how to make donations to the Project Gutenberg Literary Archive Foundation, how to help produce our new eBooks, and how to subscribe to our email newsletter to hear about new eBooks.
  • 45. back
  • 46. back
  • 47. Welcome to our website – the ideal destination for book lovers and knowledge seekers. With a mission to inspire endlessly, we offer a vast collection of books, ranging from classic literary works to specialized publications, self-development books, and children's literature. Each book is a new journey of discovery, expanding knowledge and enriching the soul of the reade Our website is not just a platform for buying books, but a bridge connecting readers to the timeless values of culture and wisdom. With an elegant, user-friendly interface and an intelligent search system, we are committed to providing a quick and convenient shopping experience. Additionally, our special promotions and home delivery services ensure that you save time and fully enjoy the joy of reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookfinal.com