100% found this document useful (2 votes)
12 views

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

The document is a guide to the Microsoft Enterprise Library Visual Basic Edition, authored by Alex Homer and others, providing solutions for enterprise development. It covers various components such as data access, error management, logging, caching, validation, cryptography, and security, along with practical examples and configuration instructions. The guide aims to assist developers in effectively using the library for building enterprise applications.

Uploaded by

baachiruosch
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
12 views

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

The document is a guide to the Microsoft Enterprise Library Visual Basic Edition, authored by Alex Homer and others, providing solutions for enterprise development. It covers various components such as data access, error management, logging, caching, validation, cryptography, and security, along with practical examples and configuration instructions. The guide aims to assist developers in effectively using the library for building enterprise applications.

Uploaded by

baachiruosch
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

Developer s Guide to Microsoft Enterprise

Library Visual Basic Edition Patterns Practices


Alex Homer pdf 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 textbooks


at ebookfinal.com
Here are some recommended products for you. Click the link to
download, or explore more at ebookfinal

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 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
DEVE LO P E R’S GU I D E TO

MICROSOFT ®

ENTERPRISE
LI B RARY
Solutions for
Enterprise Development

Alex Homer
with
Nicolas Botto
Bob Brumfield
Olaf Conijn
Grigori Melnik
Erik Renaud
Fernando Simonazzi
Chris Tavares

Visual Basic Edition


Download from Wow! eBook <www.wowebook.com>

developer’s guide to microsoft® enterprise library


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

foreword
Scott Guthrie xiii

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
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
Download from Wow! eBook <www.wowebook.com>

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
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
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

xiii
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.
Download from Wow! eBook <www.wowebook.com>

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
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.

xv
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.
the team who brought you this guide

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).

xix
Discovering Diverse Content Through
Random Scribd Documents
Live Stock.—Course includes the history, development,
characteristics, standard points, utility, adaptability to climatic
conditions; lessons on judging, care, selection and management of
the leading breeds of horses, sheep and hogs.
Second Year.—Fall Term.—Dairying.—A more comprehensive study of
milk and its constituents; weeds and their harmful effect upon dairy
products; general sanitation of dairy barns; the drawing of plans,
etc.
Poultry Raising.—Insecticides, how to make, when and how much to
use, diseases of fowls and their treatment. A study of foods and
their adaptability to different breeds, special study of turkeys and
guineas.
Horticulture.—Root and stem grafting with active and dormant buds;
formation of trunk and top starch, and its relation to the hardiness of
fruits and shrubs, botany of the orchard, entomology; book-keeping.
Floriculture and Landscape Gardening.—Systematic botany, bouquet-
making—harmony of colour, form and size of flowers; laying out of
private and public grounds, roads, parks, walks, and streets;
entomology of the flower garden.
Market Gardening.—Botany of the field and garden; physical analysis
of soils and the improvement of clay and sandy soils; the depletion
of plant food and its replacement by direct and indirect fertilisers;
the source of carbon, nitrogen and oxygen. Draining.
Live Stock.—How to hitch and unhitch horses, the care of vehicles
and harness, how to drive, the names of common diseases and
treatment of sick animals; swine for profit.
Winter Term.—Dairying.—The weighing and recording of milk in a
commercial dairy; the Babcock and other methods of testing milk;
composition of cheese and its value as a food.
Poultry Raising.—Composition of the animal body; a special study of
ducks and geese; brooders, ponds, runs, etc., by-products and their
value.
Horticulture.—Forestry, botany, cryptogamic and systematic; nut
culture; preservation of timber, the economic value of different
woods; the relation of forests to climate, water supply, floods and
erosion.
Market Gardening.—A study of the life-history of insects, injuries to
stored grain, peas, beans, meal, flour, dried fruits; botany of the
greenhouse, cold frame and hotbeds; the use of thermometers. A
study of markets, library work.
Spring Term.—Dairying.—Cottage and Cheddar cheese-making,
scoring of butter, bacteriology of milk, butter, and cheese. Judging of
dairy animals by the score-card method, diseases of cows and their
treatment; analysis of food stuffs.
Poultry Raising.—Physical and chemical study of foods, library work,
fancy breeds, what and how to exhibit, the history and development
of the industry. Heredity and the effects of in-breeding.
Horticulture.—Origin of new varieties by cross-fertilisation, hybrids,
sports, atavisms and reversion, correlation between plants and
animals, rejuvenating by pruning, grafting and scraping the bark,
special diseases of both trees and fruit, and their treatment. Knot-
growth, blight, gum excrescences and frost injuries; drying,
preserving, making fruit syrups, etc.
Horticulture and Landscape Gardening.—Special designing in
cultivated flowers. Origin of new species; bees and their relation to
the forest and garden; the hiving of bees and after-management. A
study of honey-producing plants; the economic value of the honey.
Market Gardening.—Relation of crops, geology of the garden,
agricultural chemistry, good roads and their relation to the success
and value of the farm, mineralogy and useful birds and insects.
I believe that all who will make a careful study of the subject will
agree with me that there is a vast unexplored field for women in the
open air. The South, with its mild climate and other advantages, is as
well adapted to out-door labour for women as to that for men. There
is not only an advantage in material welfare, but there is the
advantage of a superior mental and moral growth. The average
woman who works in a factory becomes little more than a machine.
Her planning and thinking is done for her. Not so with the woman
who depends upon raising poultry, for instance, for a living. She
must plan this year for next, this month for the next. Naturally there
is a growth of self-reliance, independence, and initiative.
Life out in the sweet, pure, bracing air is better from both a physical
and a moral point of view than long days spent in the close
atmosphere of a factory or store. There is almost no financial risk to
be encountered, in the South, in following the occupations which I
have enumerated. The immediate demands for the products of
garden, dairy, poultry yard, apiary, orchard, etc., are pressing and
ever present. The satisfaction and sense of independence that will
come to a woman who is brave enough to follow any of these
outdoor occupations infinitely surpass the results of such uncertain
labor as that of peddling books or cheap jewelry, or similar
employments, and I believe that a larger number of our schools in
the near future will see the importance of outdoor handwork for
women.
There is considerable significance in the fact that this year more
than fifty girls have taken up the study of scientific farming at the
Minnesota College of Agriculture, and have thus announced their
intention to adhere to country life. The college has been in existence
for the past decade, but girls have only recently been admitted. The
character of the instruction available to the girl students is
suggestive. The course presented emphasises the sciences of
botany, chemistry, physics and geology, requiring, during the
freshman and sophomore years at least, two terms' work in each of
them. Boys and girls work together throughout two-thirds of the
entire course, which includes study in language, mathematics,
science, civics, and considerable technical work. In the courses for
girls, cooking, laundering and sewing are substituted for carpentry,
blacksmithing and veterinary science. The girls, too, give more
attention to household art, home economy and domestic hygiene
than to the business aspect of farming. It is happily the chief
purpose of the college to awaken in its entire student body a keen
interest in farming, farm life, the farm-house and farm society. Both
boys and girls are taught to plan farm buildings and to lay out the
grounds artistically. Considerable attention is given to the furnishing
of houses, to literature, music and social culture, with the general
thought of making the farm home the most attractive spot on earth.
The result of the new movement is being watched with keen interest
by agriculturists and educators. It is evident that, should it prove
successful, the innovation will spread to other agricultural States. Its
influence, one readily apprehends, is apt to be social as well as
agricultural in character. Heretofore, one great drawback to farming,
even in the North, has been the difficulty of keeping the farmers'
sons on the farm. With trained and educated girls enthusiastically
taking up the profession of farming, the country life will take on new
charms, and the exodus of young men to cities will be materially
lessened.
CHAPTER X
Helping the Mothers

Something about the Woman's Meeting, organised and conducted in


the town of Tuskegee by Mrs. Washington, seems not out of place in
this book. It is her work, and she has kindly supplied the following
outline of the aims and results of this attempt to better the
conditions and lives of the people living in this typical Alabama
community:
In the spring of '92, the first Negro Conference for farmers was held
at Tuskegee. The purpose of this conference was to inspire the
masses of coloured people to secure homes of their own, to help
them to better ways of living, to insist upon better educational
advantages for them, and so to raise their standards of living,
morally, physically, intellectually and financially. Sitting in that first
meeting of Negro farmers and hearing the resolutions which stood
as the platform of the conference, I felt that history was repeating
itself. In the days of Lucretia Mott, and the early struggles of Susan
B. Anthony, women had no rights that were worth mentioning, and,
notwithstanding the fact that there were many women present at
this first conference, they had little actual place in it.
Perhaps they did not realise that they, too, had a most prominent
part to play in the life which their lovers, or their sons and husbands,
were urged to seek. Perhaps they did not dream that they would
some day have a vital part in the uplifting of our people. This
thought would not be stilled: What can these poor farmers do with
the new ideas, new hopes, new aspirations, unless the women can
be equally inspired and interested in conferences of their own?
Not many days passed before there was a fixed purpose in my mind
that these women in the homes represented by the farmers should
be reached. How to reach and help them was the question. After
many weary days and sleepless nights, praying for some way to
open, the thought came that the village of Tuskegee was a good
place to begin work. The country women, tired of the monotony of
their lives, came crowding into the village every Saturday. There
should be a place for them to go to be instructed for an hour or
more each Saturday. Like a flash the idea was caught up, and it was
not let go until such a place was secured.
Our first conference was held in the upper story of a very dilapidated
store which stands on the main street of the village. The stairs were
so rickety that we were often afraid to ascend them. The room was
used by the coloured firemen of the village, and was a dark and
dreary place, uninviting even to me. It answered our purpose for the
time. We had no rent to pay, and that was one less burden for us.
How to get the women to the first meeting was not easily settled.
For fear of opposition from friends, no mention had been made of
the plan, except to the man who let me have the room.
That first Saturday I walked up the stairs alone, and sat down in the
room with all its utter dreariness. My heart almost failed me, and not
until I remembered these words: "No man, having put his hand to
the plow and looking back, is fit for the Kingdom of God," did I
throw off the despondency. At this moment a small boy entered the
room. I said to him, "Go through the streets and say to each
woman, so that no one else will hear you, there is a woman up
those stairs who has something for you."
That first meeting I can never forget. There were six women who
came, and each one as she looked at me seemed to say: "Where is
it?" We talked it all over, the needs of our women, the best ways of
helping each other, and there was begun the first woman's weekly
conference, which now numbers nearly three hundred women.
We now have a large, roomy hall on the main street, where we
come together each Saturday, and spend two hours talking of the
things which go to make better and truer lives among women and
children. Women come long distances on foot to these meetings.
They soon brought with them their little girls, whom they could not
afford to leave at home, and there arose a new question—what to
do with the children? A plan was hit upon, and a room hired. These
girls, now more than fifty in number, are taught simple lessons, and,
at the same time, receive short practical talks on behaviour at home,
on the streets and elsewhere. We also have a small library for them,
and each one is allowed to draw the books she wants, to keep two
weeks or longer. We also have picture books on the table for the
younger children. We are now trying to get games for these children
and pictures for the walls of the room. A friend gives two hours of
her time on Saturday to these children, and it delights one's heart to
see the improvement in them in all directions, especially in their
quiet and becoming conduct on the streets.
The marked improvement among the women in the matter of dress
has been frequently commented upon in the village. They are doing
away with the wrapping of the hair, and substituting for it braiding or
some other simple arrangement. The women no longer go
barefooted, nor do they sit around the streets in a listless way. There
is less familiarity among the men and women in the streets, and in
many ways the women are being led into better ways of conduct, to
say nothing of home improvements and the closer union of family
life.
We visit the homes of the women and see that the lessons are put
into practice. We have given out thousands of papers and picture
cards, that the cracks might be closed against the wind and rain,
and that the children of the home might have something besides the
dark and cheerless logs to look at.
Soon the women began to see the importance of these conferences,
and to do all in their power to promote their interests. Our talks
were discussed on the farms and in neighbourhood chat. Their
influence spread in indirect channels. These talks were planned
along such simple and practical lines as the following subjects
suggest:
Morals among young girls.
The kinds of amusements for young girls.
A mother's example.
A mother's duty to her home.
Dresses for women and children.
Poultry raising for women.
The part a woman should take in securing a home.
Fruit canning, etc.

Many other subjects were suggested by the women themselves, and


afterward put in written form so that they could read them
intelligently. Many of the talks were grouped in a little book for
women who could not reach the conferences. These books contain
also little recipes which any woman may need in her country home,
especially when there is sickness in the family. Work for the masses
is always more difficult than for the individual, but it is work which
must be done. Eighty per cent. of our women have their homes in
the country or on the plantations, they live in the old-time log
cabins, but they have hearts, they have aspirations for the future. In
pursuance of the ideas which prompted this humble crusade, I have
sent out leaflets which embody, among others, these suggestions for
teachers and other workers, which I have found exceedingly helpful
in organising home-union meetings for mothers:
Decide upon a definite time for holding a meeting, and then send
notice to the mothers by the school children.
Once every three or six months have a general meeting with simple
refreshments such as can be gotten in a country village.
Now and then an experience meeting can be held to the advantage
of all. Encourage the women to talk freely of their own plans.
Find out by judicious visiting whether any advancement is made.
Do not expect too much in a short time, and, above all, do not be
dictatorial while visiting, or personal in meetings when you wish to
deal with mistakes that you have seen in the homes visited.
Some Subjects for Talks
How to keep home neat and tidy.
How to make home attractive for husband and children.
Amusements, music and reading in the home circle.
Is it necessary to teach the girls to do good by teaching them how
to do housework, cooking and sewing?
The relations of mothers to their children.
How to gain the confidence of children.
How to correct falsehood and theft among boys and girls.
Is there not a share in the home for the boys?
How to teach boys and men to respect women generally by teaching
them to respect mothers and sisters.
The mother's authority in selecting company for her sons and
daughters.
When should a girl be allowed to receive company? How can a
mother help her to avoid mistakes as regards the young man she
loves?
What part should a woman take with her husband in securing a
home or a piece of land on which to build one?
What is the effect upon the face when the hair is wrapped with
coloured strings? Why not plat it or arrange it in some other
becoming way?
Should women go barefooted?
Love of gaudy dress for children. What will the result be when they
are older and cannot afford to buy the same sort?
Manners on the street.
Necessity of varying diet for the household.
Economy in the house as regards food.
The proper duty of mothers in having the family table set with care
at the proper time.
The importance of ventilation, proper food, and cleanliness of body
on the moral atmosphere of the home.
What lessons can be drawn from Thanksgiving Day, New Year's and
Christmas?
The mother's relation to the church and the minister.
How the family should go to church. Isn't it better if all go together
and sit together, too?
How can boys and girls be taught the habit of giving to the church
and charitable purposes?
How may mothers and their daughters best resist men who attempt
to rob them of their honour and virtue?
The best way to inspire children to purity of thought, speech, and
action, at home and abroad?
In a leaflet of practical help, for these mothers' meetings, some of
the simple teachings are put in detail form, and these may give an
idea of what we are trying to do in these directions, and what are
the common needs of the people among whom we are working.
Under the head of "Your Needs" are the following items:
You need chairs in your houses. Get boxes. Cover them with bright
calico, and use them for seats until you can buy chairs. You need
plates, knives and forks, spoons and table-cloths. Buy them with
tobacco and snuff money.
You need more respect for self. Get it by staying away from street
corners, depots, and, above all, excursions. You need to stay away
from these excursions to keep out of bad company, out of court, out
of jail, and out of the disgust of every self-respecting person.
You need more race pride. Cultivate this as you would your crops. It
means a step forward. You need a good home. Save all you can. Get
your own home, and that will bring you nearer citizenship. You can
supply all these needs. When will you begin? Every moment of delay
is loss.
How to Become Prosperous
Keep no more than one dog. Stay away from court. Buy no snuff,
whisky and tobacco. Raise your own pork. Raise your own
vegetables. Put away thirty cents for every dollar you spend.
Get a good supply of poultry. Set your hens.
Keep your chickens until they will bring a good price.
Go to town on Thursday instead of Saturday. Buy no more than you
need.
Stay in town no longer than necessary.
My Daily Work
I may take in washing, but every day I promise myself that I will do
certain work for my family. I will set the table for every meal. I will
wash the dishes after every meal.
Monday I will do my family washing. I will put my bedclothes out to
air. I will clean the food closet with hot water and soap.
Tuesday I will do my ironing and family patching.
Wednesday I will scrub my kitchen, and clean my yard thoroughly.
Thursday I will clean and air the meal and pork boxes. I will scour
my pots and pans with soap and ashes.
Friday I will wash my dish-cloth, dish-towels, and hand-towels. I will
sweep and dust my whole house, and clean everything thoroughly.
Saturday I will bake bread, cake, and do other extra cooking for
Sunday. I will spend one hour in talking with my children, that I may
know them better.
Sunday I will go to church and Sunday School. I will take my
children with me. I will stay at home during the remainder of the
day. I will try to read aloud a something helpful to all.
Questions I Will Pledge Myself to Answer at the End of the Year
How many bushels of potatoes, corn, beans, and peanuts have we
raised this year?
How many hogs and cows do we keep? How much poultry have we
raised? How many bales of cotton have we raised? How much have
we saved to buy a home?
How much have we done toward planting flowers and making our
yard look pretty? How many kinds of vegetables did we raise in our
home garden?
How many times did we stay away from miscellaneous excursions
when we wished to go? What were our reasons for staying at home?
Have we helped our boys and girls to stay out of bad company?
What paper have we taken, and have we taken our children to
church and had them sit with us?
The experiment of real settlement work on a plantation near
Tuskegee was begun in 1896 in a dilapidated, unused one-room
cabin in the quarters of the "big house," where resided the last scion
of a family of slave-holders.
Seventy-five families lived scattered in cabins over the two-
thousand-acre plantation in easy access to their plots of land farmed
on shares. Many of the men were paying for "time" bought by the
owner of the plantation. Some had been arrested, and on trial found
guilty. They had to pay either a certain sum or suffer imprisonment.
The owner of the plantation paid the fines, and the men paid him for
their time in labour. Schools were miles distant, and the only
opportunity to teach the better way of life seemed to be establishing
a settlement. The planter graciously granted the free use of the
cabin aforesaid. Students from the Institute nailed the shingles on
the open roof. The room was given a thorough cleaning, and in a
short time a young woman graduate, now wife of the Principal of
Christianburg Institute, Cambria, Virginia, and an undergraduate
moved in with her home-made furniture—fashioned from dry-goods
boxes, and covered with pretty chintz sent by an old friend who has
now passed to her reward.
As a Sunday School had begun in one of the log houses several
Sundays previous to the opening of the settlement, the young
teacher's coming had been explained, and all had promised to
contribute all they could to her support.
HOME-MADE FURNITURE
The first articles of food entered on the teacher's book to the credit
of her patrons were two eggs, one can of syrup, one half-pound
bacon, one quart meal, one can buttermilk. The teacher cooked her
meals on her oven in the fireplace, did her work, and taught school
in her cabin. The first day brought fifteen boys and girls. Ten of the
fathers and mothers, eager to learn how to read and write, came to
the night school. For two years the teacher struggled. Her patrons
helped her with larder, and grew—measuring up to the standards of
true living.
In spite of frequent patchings, the teacher's cabin became almost
unfit for use. There came a time when umbrellas were indispensable
in the cabin during a heavy downpour. In 1898 a way opened for the
purchase of ten acres of woodland. A two-room cottage was built for
the teacher on a clearing. No prouder workers could be found than
the teacher and her pupils in clearing the land for possible crops.
Beginning with 1900, the average annual yield was as follows: Two
bales of cotton, forty bushels of corn, seventy-five bushels sweet
potatoes, twenty bushels peanuts, twenty bushels pease, four loads
shucks and fodder, greens, cabbage, and other vegetable products.
Two years ago a kitchen was added to the cottage, and the cooking
classes of the school arose to the dignity of having a real stove and
other necessaries. Sewing, cooking, gardening, and housekeeping
classes have succeeded wonderfully. The boys of the settlement
have received first prizes from Tuskegee Institute Agricultural Fair for
their products put on exhibition.
One of the first fruits of the settlement work has been the promotion
of a boy from that school to Tuskegee Institute. He has stood the
test of four years in his classes, industrial and academic, and is now
most promising.
The second step to place the work on a hopeful basis has been the
purchase of ten more acres of land. A two-room cottage has been
built recently, and the mother of the first settlement boy to come to
the front, and one of our pioneer workers in the venture, has been
given a chance to not only earn her living, but to serve as a native
object-lesson of neatness in her home and surroundings. Eight years
of constant work teaching old and young how to live has resulted in
better built homes on the plantation. Owner has replaced one-room
log cabins with two-room cottages.
House to house visits and the object-lesson of the settlement work
have told for good in the matter of cleanliness. The marriage tie is
respected. It is the exception rather than the rule to find unmarried
mothers living with their children's fathers without even a sense of
shame.
The barefoot boys and girls, men and women, who first attended the
settlement Sunday School eight years ago, come neatly dressed.
Men and women who could not read or write in the beginning of the
work can read their Sunday School lessons and write a presentable
note in a matter of business.
The Mothers' Union has brought the mothers to see the deep
necessity of exerting their influence for good of home and people.
The penny savings bank held by the teacher represents stockholders
that mean to be owners of their own homes.
In the night school, the grown people, who are employed during the
day, are taught the simple lessons which were neglected in their
youth. At first many of them were ashamed to admit their ignorance.
One young man, whom Mrs. Washington noticed during one of her
visits as being particularly sullen when asked to join the class, has
turned out to be one of the most ambitious pupils. "At first I was
almost afraid to speak to him," she said, "but after I talked to him a
little while, he broke down quite suddenly, and exclaimed:
"Oh, Mis' Washington! I'se so ashamed, I don't even know my
letters." But it is the classes in cooking and cleaning and sewing
which have been most successful, and these are responsible more
than anything else for the change in the women.
From the outset, the white planters who employ most of the
coloured families of the settlement have aided in the work. When
Mrs. Washington first sent for permission to carry on some
missionary work among his tenants, he sent a boy on a mule with a
fat turkey, and a message for me to "come and do anything I liked."
What seemed to be a discouragement at first was that occasionally a
family moved away, thus causing the teacher to begin all over again,
with a newcomer, the work which had been scarce finished with the
old. Later she came to see that those who migrated served to spread
the influence into other neighbourhoods, thus broadening the
teachings far beyond her own limitations.
CHAPTER XI
The Tillers of the Ground

There is held at the Tuskegee Institute every year a remarkable


conference of Negro workers, mostly farmers, who are to work out
their salvation by the sweat of their brows in tilling the soil of the
South. The purpose of these gatherings is severely practical—to
encourage those who have not had the advantages of training and
instruction, and to give them a chance to learn from the success of
others as handicapped as they what are their own possibilities. As I
have said many times, it is my conviction that the great body of the
Negro population must live in the future as they have done in the
past, by the cultivation of the soil, and the most hopeful service now
to be done is to enable the race to follow agriculture with
intelligence and diligence.
I have just finished reading a little pamphlet written by Mr. George
W. Carver, Director of the Agricultural Department at Tuskegee,
giving the results of some of his experiments in raising sweet
potatoes for one year. This coloured man has shown in plain, simple
language, based on scientific principles, how he has raised two
hundred and sixty-six bushels of sweet potatoes on a single acre of
common land, and made a net profit of one hundred and twenty-one
dollars. The average yield of sweet potatoes to the acre, in the part
of the South where this experiment was tried, is thirty-seven bushels
per acre. This coloured man is now preparing to make this same
land produce five hundred bushels of potatoes.
I have watched this experiment with a great deal of pleasure. The
deep interest shown by the neighbouring white farmers has been
most gratifying. I do not believe that a single white farmer who
visited the field to see the unusual yield ever thought of having any
prejudice or feeling against this coloured man because his education
had enabled him to make a marked success of raising sweet
potatoes. There were, on the other hand, many evidences of respect
for this coloured man and of gratitude for the information which he
had furnished.
If we had a hundred such coloured men in each county in the South,
who could make their education felt in meeting the world's needs,
there would be no race problem. But in order to get such men, those
interested in the education of the Negro must begin to look facts
and conditions in the face. Too great a gap has been left between
the Negro's real condition and the position for which we have tried
to fit him through the medium of our text-books. We have
overlooked in many cases the fact that long years of experience and
discipline are necessary for any race before it can get the greatest
amount of good out of the text-books. Much that the Negro has
studied presupposes conditions that do not, for him, exist.
The weak point in the past has been that no attempt has been made
to bridge the gap between the Negro's educated brain and his
opportunity for supplying the wants of an awakened mind. There has
been almost no thought of connecting the educated brain with the
educated hand. It is almost a crime to take young men from the
farm, or from farming districts, and educate them, as is too often
done, in everything except agriculture, the one subject with which
they should be most familiar. The result is that the young man,
instead of being educated to love agriculture, is educated out of
sympathy with it; and instead of returning to his father's farm after
leaving college, to show him how to produce more with less labour,
the young man is often tempted to go into the city or town to live by
his wits.
The purpose of the Tuskegee Negro Conference is to help the
farmers who are too old, or too bound down by their responsibilities,
to attend schools or institutes; to do for them, in a small way, what
Tuskegee and other agencies seek to do for the younger generation.
Coloured men and women make long and expensive journeys to be
present, coming from all the Southern and several of the Northern
states. They have found that their money is not wasted, for they
learn much by seeing what has been done at the school, from the
advice of experts, but more especially by the exchange of opinions
and by comparing experiences in their own field of work. These
meetings are not for whining or complaints. Their keynote is hopeful
courage. To look up and not down, forward and not backward, to be
cheerful and mutually helpful, is the golden rule of the conference.
It was decided from the first to confine the proceedings to matters
which the race had closely within its own control, and to positive,
aggressive effort, rather than to mere negative criticisms and
recitations of wrongs. I wanted these coloured farmers and their
wives to consult about the methods and means of securing homes,
of freeing themselves from debt, of encouraging intelligent
production, of paying their taxes, of cultivating habits of thrift,
honesty and virtue, of building school-houses, and securing
education and high Christian character, of cementing the friendships
between the races.
In these conventions, as in other ways, we have tried to keep alive
the feeling of hope and encouragement. We have seen darker days
than these, and no race that is patient, long-suffering, industrious,
economical, and virtuous, no race that is persistent in efforts that
make for progress, no race that cultivates a spirit of good-will toward
all mankind, is left without reward.
The Farmers' Conference each year adopts a declaration of
principles, which sum up its objects in such words as these:
"Our object shall be to promote the moral, material, and educational
progress of this entire community. Believing, as we do, that we are
our own worst enemies, we pledge, here and now, from this time
forth, to use every effort—
"To abolish and do away with the mortgage system just as rapidly as
possible.
"To raise our food supplies, such as corn, potatoes, syrup, pease,
hogs, chickens, etc., at home rather than to go in debt for them at
the store.
"To stop throwing away our time and money on Saturdays by
standing around towns, drinking and disgracing ourselves in many
other ways.
"To oppose, at all times, the excursion and camp-meeting, and to try
earnestly to secure better schools, better teachers, and better
preachers.
"To try to buy homes, to urge upon all Negroes the necessity of
owning homes and farms, and not only to own them, but to beautify
and improve them.
"Since the greater number of us are engaged in agriculture, we urge
the importance of stock and poultry raising, the teaching of
agriculture in the country schools, the thorough cultivation of a small
acreage, rather than the poor cultivation of a large one, attention to
farm-work in winter, and getting rid of the habit of living in one-room
houses.
"We urge more protection to life and property, better homes for
tenants, and that home life in the country be made more attractive,
all this with the view of keeping such great numbers of our people
out of the large cities.
"In connection with the better schools and churches, we emphasise
the need of careful attention to the morals of our ministers and
teachers, and all others acting in the capacity of leaders.
"Prosperity and peace are dependent upon friendly relations
between the races, and to this end we urge a spirit of manly
forbearance and mutual interest."
What these conferences are doing, and what sort of people are
coming to them every year, may be gathered from some of their
experiences as they have told them themselves during their visit to
Tuskegee. Some of the best things are said by men and women who
have succeeded in working their way up from abject poverty to
comfortable independence. There is no better antidote for the foolish
talk so often heard about the inevitable shiftlessness of the Negro
race than these short and pithy narratives of sacrifice, struggle and
achievement. A Florida man said that he had six dollars when he
married. He now owns two hundred acres and a home of seven
rooms. "I did without most everything until I got it paid for," he
explained. He has fifty-seven head of cattle, six work horses, and
five colts, all raised by himself. Is it dangerous to give the ballot to
that kind of a citizen? Will he be apt to use it to promote extravagant
taxation?
An Alabama farmer said:
"I own sixty-seven acres of land. I got it by working hard and living
close. I did not eat at any big tables. I often lived on bread and milk.
I have five rooms to my house. I started with one, and that was
made of logs. I add a room every year. I was lucky in marrying a
woman whose father gave her a cow. I ain't got no fine clock or
organ. I did once own a buggy, but it was a shabby one, and now
we ride in a wagon, or I go horse-back on a horse I raised that is
worth two hundred and fifty dollars. I have seven children in school."
"I started plowing with my pants rolled up and barefoot," said a
Georgia man. "I saved five hundred dollars and bought a home in
Albany, Georgia. I bought two hundred acres for seven dollars an
acre, and paid for it in three years. I made that pay for two hundred
acres more. After awhile I bought thirteen hundred acres. I live on
it, and it is all paid for. I have twenty-five buildings and they all came
out of my pocketbook. That land is now worth twenty-five dollars an
acre. For a distance of four or five miles from my settlement, there
has not been a man in the chain-gang for years. I work forty-seven
head of mules. The only way we will ever be a race is by getting
homes and living a virtuous life. I don't give mortgages. I take
mortgages on black and white. I have put the first bale of cotton on
the market in Georgia every year for eight years."
A widow from Alabama told her story, which shows among other
things how a dog may be useful:
"There are three in my family, and I am the boss. I save about a
hundred dollars a year. I give no mortgages. I plant everything that
a farmer can plant. I raise my own syrup, meat, pease, corn, and
everything we need to eat. I have three cows. You have got to go
low down to get up high. I traded a little puppy with my brother for
a pig. From this one pig I raised eight pigs, and for seven years I
have not bought a pound of meat. I am living on the strength of that
little puppy yet. I own forty acres, and sometimes rent more land."
A coloured minister from Alabama said that he farmed as well as
preached. He was a renter for seven years. In nine years he paid for
four hundred acres, and now owns ten hundred and fifteen acres.
He raises horses, cows, mules, and hogs and has fifty persons
dependent upon him. He owns the land where he used to live as a
renter, and lives in the house of the man from whom he rented.
There are few white people in his neighbourhood. Most of the
coloured people own their own homes, and they have lengthened
the annual school term two months at their own expense. This man
said that, when he first bought land, he split rails to fence it during
the day and carried them around at night, and his wife built the
fence.
A South Carolinian, who was never before so far from home, said
that he was a slave for twenty years. "I used to work six days for my
master, and Sunday for myself," he said. "God introduced ten
commandments, but our people have added another, 'Thou shalt not
work Saturdays or Sundays, either.' I stick to the Ten
Commandments and put in six days a week, and in that way have
bought three hundred acres and paid for it. I have a large house for
my own family of ten, and fourteen other buildings on the place, six
of them rented. No man is a farmer excepting the man who lives on
the produce of his farm."
A visitor from Louisiana told how he had borrowed two hundred and
fifty dollars from his father and bought twenty-five acres of land in
1877. He used to begin work at four o'clock in the morning. For a
year his wife ground all their meal, three ears at a time, in a small
hand-mill. Now he owns three hundred acres of sugar land, worth a
hundred dollars an acre, and has twenty-seven white and forty-eight
coloured people working for him.
"I would like to set a big table for you," said one of these farmers
whom I visited at his home, "but, professor, you-all is teachin' us to
'conermise an' save, an' dats what I'se tryin' to do." When you
remember how anxious the good farmers and their wives are always
to set a good table for the visiting "professors" and "revrums," this
man had a good deal of courage in departing from old customs.
I say to the farmers: "If feeding the 'brutherins' is a strain on you,
feed no more of them. Cut down on all expenses that can be
trimmed without injury to yourself."
One woman from Bullock County, Alabama, carried away the true
spirit of the conference. Not long ago, one of our agents saw a deed
to a valuable piece of farm land, bought with money she had saved
by selling cows. She said that she had never thought of any such
plan until she had visited the Farmers' Conference and heard others
tell how they had bought land. An unusual feature of this case was
that the woman did not live in the town in which she had invested
her money. She had made herself interested enough to seek a
chance to invest her earnings in the purchase of property several
miles from her home settlement. She said that it required a mighty
sight of will-power to keep from buying fine clothes with the money,
but she was determined to get hold of some land, and she did it
without any assistance from her husband.
"Yes, of course I'll be at the next Negro Conference," wrote another
farmer, "I want you to give me a chance to talk, too. I want to show
Mr. Washington a turnip I raised in my own garden, and have been
saving for the Conference, and I want to tell him how much I have
raised and eaten out of my own garden, and how much I have saved
as the result of these teachings at the annual meetings."
Another wrote recently:
"I have to buy very little to eat, for I raise with one horse all I want
to eat, and a little more besides. Last year I raised nine bales of
cotton, plenty of corn, sugar cane, pease, and potatoes, and many
other things. Besides this, my wife raised twenty hogs, and a yard
full of chickens, geese and turkeys. The only way for the farmer to
get out of debt and keep out of debt is to buy a home, raise what he
eats, and pay at once for what he gets out of the store."
A pilgrim from Georgia thus expressed himself:
"I came here to get my keg full of good news and glad tidings to
carry back to Georgia, and I have got it. I began working for myself
when I was eighteen years old. My father and mother died when I
was a child. I first worked for eight dollars and fifty cents a month
and my board, and cleared eighty-three dollars the first year. Then I
worked on shares for a while, then I bought a mule on credit, using
my money to support myself while raising a crop. Now I own fifteen
hundred acres of land, all paid for. I have six rooms in my house. I
don't give any mortgages. I have twenty-three plows, and a bank
account. I haul on my drays about ten thousand bales of cotton
every year for the planters in my county. I have another patch of
fifty acres near Fort Gaines on which there is a six-room house."
"We come here to learn wisdom and knowledge," said a man from
Macon County, Alabama. "I had a part of the slavery time, and I've
had all of the freedom time. When I was in my eighteenth year I
wanted to marry the worst way. I did it somehow, and then we tried
every plan to get ahead in the world. I worked Sunday as well as
Monday. I even hitched myself to the plow, and my wife plowed me.
Now I have got horses, mules, corn, and plenty of everything to do
me, but I have not got any home. Next year when I come here I am
going to own a place of my own instead of renting it."
Scores of similar illustrations could be quoted to show that the Negro
farmer is fighting his own battles, and that in his annual visits to
Tuskegee he preaches, both to the students and to his fellow toilers,
the gospel of work with the hands as the pathway to freedom. The
kind of practical advice distributed among these farmers is illustrated
in the following specimen of the leaflets issued by our "Bureau of
Nature Study for Schools." This one on Hints and Suggestions for
Farmers has to do with the ever-vital question of "Mortgage Lifting":
"Farmers all over the Cotton Belt are now finishing their plans for the
growing of this year's crop. All sorts of financial plans have been
made. Perhaps the most common among our farmers is the credit
plan or crop mortgage. In this the farmer binds himself and family to
make a crop, usually cotton, for any one who will 'advance' him what
he must buy while growing the crop. He agrees to pay interest,
ranging from ten to thirty-five per cent. on the cost of the things
furnished. Thus a pair of shoes which would sell for $1.50 in cash
would cost about $2 in the fall. If allowed to run until the next Fall, it
would cost him about $2.50. If allowed to run three years, it would
take $3.15 to pay for a $1.50 pair of shoes. If carried the fourth
year, it would take $4, and one year more would call for $5.
"Too many farmers are paying $5 for shoes which would have cost
them only $1.50 if they had managed their business properly. Too
many times the $5 shoes are never paid for, leaving an unkindly
feeling between the 'advancer' and the one 'advanced,' causing the
landlord and tenant, and very often the merchant, to suffer.
"Yet the farmer must have clothing. He must have plows, hoes,
wagons, etc. No man who tills the soil should have to suffer for
something to eat. Perhaps no one will question the farmer's right to
make the crop mortgage. He must and ought to have plenty of
good, wholesome food to make it possible for him to do his work
well. But for his own good, the good of his family, for the good of
the landlord, and the community in which he lives, we do dispute his
right to manage business as many of our farmers do. He should not
make a mortgage he cannot easily lift.
"If it requires $150 to supply a farmer for a season, at the end of
that season his debt will be about $180—an extra $30, the average
value of a bale of cotton, to do a credit business. If it requires $75 to
carry him, he will owe about $90, costing him half a bale of cotton to
do a credit business. Now, do you note that the smaller the amount
borrowed, the smaller the amount of interest, and the easier it
becomes for the farmer to lift the whole thing? Don't load so heavily.
Put two thousand pounds on a thousand-pound wagon and see what
becomes of you, your load, and your wagon. One man tries by main
strength to lift a large load. He fails and gives up in despair. Another
man gets a long pole, or lever, and with the greatest ease raises and
places the load where it is wanted. The first uses only muscle, while
the last mixes muscle with brains.
"Could we not say the same thing of the unsuccessful and the
successful mortgage lifter? If you will use your head and go at that
debt in the right way, you will be surprised with what great ease you
can get it out of the way. Well, how can this be done, one man asks?
What would you advise? A wise man listens to advice. If he thinks it
good, he will try to follow it. The farmer who is in debt must—
"Not make bad bargains. He must work all day and sometimes part
of the night, and buy only what he is compelled to have. He should
raise everything he eats and a little more, and then cultivate as
much cotton as he can.
"Some of the farmers buy shoddy goods at fair prices. They allow
the boys and girls to buy cheap jewelry. They buy a sewing machine
on credit for fifty or sixty dollars, and when they get it paid for, if
they ever do, it has cost about a hundred dollars. They pay ten and
fifteen dollars for a washstand and bureau when an upholstered box
would do for the present. The industrious farmer works from sunrise
to sunset every day in the week. If there is some light work he can
do by putting in two or three hours during the long winter nights,
you find him at it. It takes this to lift the mortgage.
"The sensible farmer will not buy five hundred pounds of bacon if
there is any way to get along with two hundred and fifty. If he must
buy it on credit, he will eat butter, drink milk, raise and eat eggs and
chickens, kill a young beef when he can, and dry or pickle it, so as to
supply his wants from his own produce as long as possible.
"The farmer who wants to get out of debt will have large patches of
greens, his garden will have something growing in it the year round.
His table will be loaded with wild fruits, such as blackberries,
huckleberries, plums, etc. His potatoes will keep him from buying so
much corn meal and flour on credit. He plans to raise more than
enough corn, oats, and wheat to do him another year. Then he
makes that cotton crop count. He gathers every lock of it as fast as
it opens and tries to sell it for every cent it is worth. He walks up like
a man and pays every cent he owes when it falls due. Then his
neighbours, both white and coloured, learn to respect him because
he is an honest man, he owes nobody, his store-house, smoke-
house, and barn are loaded with fruits, and home-made produce. He
is a happy man because that mortgage is lifted."
CHAPTER XII
Pleasure and Profit of Work in the Soil

I have always been intensely fond of outdoor life. Perhaps the


explanation for this lies partly in the fact that I was born nearly out-
of-doors. I have also, from my earliest childhood, been very fond of
animals and fowls. When I was but a child, and a slave, I had many
close and interesting acquaintances with animals.
During my childhood days, as a slave, I did not see very much of my
mother, as she was obliged to leave her children very early in the
morning to begin her day's work. Her early departure often made
the matter of my securing breakfast uncertain. This led to my first
intimate acquaintance with animals.
In those days it was the custom upon the plantation to boil the
Indian corn that was fed to the cows and pigs. At times, when I had
failed to get any other breakfast, I used to go to the places where
the cows and pigs were fed, and share their breakfast with them, or
else go to the place where it was the custom to boil the corn, and
get my morning meal there before it was taken to the animals.
If I was not there at the exact moment of feeding, I could still find
enough corn scattered around the fence or the trough to satisfy me.
Some people may think that this was a pretty bad way to get one's
food, but, leaving out the name and the associations, there was
nothing very bad about it. Any one who has eaten hard boiled corn
knows that it has a delicious taste. I never pass a pot of boiled corn
now without yielding to the temptation to eat a few grains.
Another thing that assisted in developing my fondness for animals
was my contact with the best breeds of fowls and animals when I
was a student at the Hampton Institute. Notwithstanding that my
work there was not directly connected with the stock, the mere fact
that I saw the best kinds of animals and fowls day after day
increased my love for them, and made me resolve that when I went
out into the world I would have some as nearly like those as
possible.
I think that I owe a great deal of my present strength and capacity
for hard work to my love of outdoor life. It is true that the amount of
time that I can spend in the open air is now very limited. Taken on
an average, it is perhaps not more than an hour a day, but I make
the most of that hour. In addition to this, I get much pleasure out of
looking forward to and planning for that hour.

CLASS IN NATURE STUDY


I do not believe that any one who has not worked in a garden can
begin to understand how much pleasure and strength of body and
mind and soul can be derived from one's garden, no matter how
small it may be, and often the smaller it is the better. If the garden
be ever so limited in area, one may still have the gratifying
experience of learning how much can be produced on a little plot
carefully laid out, thoroughly fertilised, and intelligently cultivated.
And then, though the garden may be small, if the flowers and
vegetables prosper, there springs up a feeling of kinship between the
man and his plants, as he tends and watches the growth of each
individual fruition from day to day. Every morning brings some fresh
development, born of the rain, the dew, and the sunshine.
The letter or the address you began writing the day before never
grows until you return and take up the work where it was left off;
not so with the plant. Some change has taken place during the
night, in the appearance of bud, or blossom, or fruit. This sense of
newness, of expectancy, brings to me a daily inspiration whose
sympathetic significance it is impossible to convey in words.
It is not only a pleasure to grow vegetables for one's table, but I find
much satisfaction, also, in sending selections of the best specimens
to some neighbour whose garden is backward, or to one who has
not learned the art of raising the finest or the earliest varieties, and
who is therefore surprised to receive new potatoes two weeks in
advance of any one else.
When I am at my home in Tuskegee, I am able, by rising early in the
morning, to spend at least half an hour in my garden, or with my
fowls, pigs, or cows. Whenever I can take the time, I like to hunt for
the new eggs each morning myself, and when at home I am selfish
enough to permit no one else to make these discoveries. As with the
growing plants, there is a sense of freshness and restfulness in the
finding and handling of newly laid eggs that is delightful to me. Both
the anticipation and the realisation are most pleasing. I begin the
day by seeing how many eggs I can find, or how many little chickens
are just beginning to peep through the shells.
Speaking of little chickens coming into life reminds me that one of
our students called my attention to a fact connected with the
chickens owned by the school which I had not previously known.
When some of the first little chickens came out of their shells, they
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

You might also like