Beruflich Dokumente
Kultur Dokumente
asp
ONLY TO PROVIDE A PRINTER FRIENDLY VERSION
Enterprise Library , patterns & practices Library, Microsoft Corporation, January 2005
Summary
The patterns & practices Enterprise Library is a library of application blocks designed to assist
developers with common enterprise development challenges. Application blocks are a type of
guidance, provided as source code that can be used "as is," extended, or modified by developers to use
on enterprise development projects. Enterprise Library features new and updated versions of
application blocks that were previously available as stand-alone application blocks. All Enterprise
Library application blocks have been updated with a particular focus on consistency, extensibility, ease
of use, and integration.
Downloads
The latest release of Enterprise Library was released in January 2005:
Download Enterprise Library, January 2005
The terms of use of Enterprise Library are specified in the End User Licensing Agreement (EULA).
Contents
The Enterprise Library Application Blocks
Vision and Design Themes
What Is Guidance?
Community
Feedback and Support
Roadmap
Reviewers
What Is Guidance?
Enterprise Library is a guidance offering, designed to be reused, customized and extended. It is not a
Microsoft product. The following table describes some of the key attributes of code-based guidance
offerings, including Enterprise Library.
Attribute Description
Support Code based guidance is shipped "as is" and without warranties. Customers can obtain
support, but the code is considered user-written by Microsoft support staff. The patterns
& practices team works with product support and will assist them with escalations as
needed. Customers are encouraged to support one another through online communities.
Functionality Provides a flexible and architecturally sound solution to a common enterprise
development challenge, which is not easy to achieve with the base platform without
moderate effort or intricate knowledge of it. The guidance addresses the challenges by
using base platform features and adhering to its best practices. The guidance is designed
to be extended and customized by users.
Release Guidance releases are typically developed in a 3-6 month life cycle. Assets are released
as they become ready on the currently available platform. New versions of existing
assets (possibly revised to run on later versions of the platform) are released if there is
sufficient customer demand.
Compatibility Code-based guidance is designed to help solve problems over specific versions of
Microsoft products. As the products change, the guidance issued may change or become
obsolete. We develop the guidance with future releases in mind when possible. There
are no guarantees about guidance compatibility with earlier releases of guidance, or
with past or future platform releases. A phased migration strategy is recommended, and
coexistence of multiple versions of the guidance is given high priority by the patterns &
practices team.
Form factor Released as source code. Variability is provided through configuration and defined
extensibility points, as well as through direct modification of the source code.
Documentation focuses on how to use the asset, how to extend it, and the goals, patterns
and tradeoffs driving its design.
Community
Enterprise Library, like other patterns & practices deliverables, is associated with a community site.
On this community site, you can post questions, provide feedback, or connect with other users for
sharing ideas. Community members can also help Microsoft plan and test future application blocks,
and download additional content such as extensions and training materials.
Enterprise Library is a guidance offering, designed to be reused, customized and extended. It is not a
Microsoft product. Code-based guidance is shipped "as is" and without warranties. Customers can
obtain support through Microsoft Support Services for a fee, but the code is considered user-written by
Microsoft support staff. For more information on our support policy, see What Is Guidance? earlier on
this page.
Roadmap
The next release of Enterprise Library will target the .NET Framework 2.0 and Visual Studio 2005.
This release will include updated versions of existing Enterprise Library application blocks make the
new features of the .NET Framework 2.0. In addition, the library will feature additional application
blocks.
More information about this new release will be published as it becomes available. To participate in
defining requirements, reviewing specifications, and testing early releases, please join the Enterprise
Library Community.
Reviewers
Many thanks to the following reviewers who provided invaluable assistance:
Kawarjit Bedi, Pablo Castro, Krzysztof Cwalina, Carl Ellison, Jonathan Hawkins, David Keogh,
Wojtek Kozaczynski, David Lee, James Newkirk, Shanku Niyogi and Brenton Webster (Microsoft
Corporation); Rudy Araujo, Yen-Ming Chen, Mark Curphey, and David Raphael (Foundstone); Benoit
Morneau and Shoichi Takasaki (Bowne Global Solutions)
Downloads
The latest release of the Caching Application Block is included as a part of the patterns & practices
Enterprise Library, January 2005. To learn about and download Enterprise Library, use the following
links:
Enterprise Library home page
Download Enterprise Library, January 2005
The terms of use of Enterprise Library are specified in the End User Licensing Agreement (EULA).
You can also download the earlier release of the Caching Application Block from the Microsoft
Download Center's Caching Application Block Web page.
Contents
Introduction to the Caching Application Block
Design of the Caching Application Block
Test Drive
Community
Feedback and Support
Roadmap
Authors and Contributors
Related Titles
Performance. Caching improves application performance by storing relevant data as close as possible
to the data consumer. This avoids repetitive data creation, processing, and transportation.
Scalability. Storing information in a cache helps save resources and increases scalability as the
demands on the application increase.
Availability. By storing data in a local cache, the application may be able to survive system failures
such as network latency, Web service problems, and hardware failures.
Common Scenarios
The Caching Application Block is suitable for any of the following situations:
You must repeatedly access static data or data that rarely changes.
Data access is expensive in terms of creation, access, or transportation.
Data must always be available, even when the source, such as a server, is not available.
The Caching Application Block can be used with any of the following application types:
Windows Forms
Console
Windows Service
Enterprise Services
ASP.NET Web application or Web service if you need features that are not included in the ASP.NET
cache
The Caching Application Block should be deployed in a single application domain. Each application
domain can have one or multiple caches, either with or without backing store(s). Caches cannot be
shared among different application domains.
The Caching Application Block is optimized for performance and is both thread safe and exception
safe. You can extend it to include your own expiration policies and your own backing store.
Audience Requirements
This application block is intended for software architects and software developers. To benefit fully
from this guidance, you should have an understanding of the following technologies:
Microsoft Visual C# development tool or Microsoft Visual Basic development system
.NET Framework
Highlights of Version 1.0 Release
The Enterprise Library Caching Application Block, version 1.0, includes the following new features:
You can use a graphical tool, the Enterprise Library Configuration Console, for managing
configuration settings.
You can configure a persistent storage location, using either isolated storage or the Enterprise Library
Data Access Application Block, whose state is synchronized with the in-memory cache.
You can extend the application block by creating custom expiration policies and storage locations.
You receive assurance that the application block performs in a thread safe manner.
System Requirements
To develop applications using the Caching Application Block, you need the following:
Microsoft Windows 2000, Windows XP Professional, or Windows Server 2003 operating system
Microsoft .NET Framework 1.1
Microsoft Visual Studio .NET 2003
The Caching Application Block depends on other application blocks and code included in the
Enterprise Library:
The Configuration Application Block. The Caching Application Block uses this to read its
configuration information.
Common library functionality. An example of this is instrumentation; it provides various functions for
exposing events and data used for system management.
The Data Access Application Block. You need this application block if you are going to use a database
as a backing store.
Additionally, the application block uses XML files to store configuration information. The
recommended way to modify this information is to use the Enterprise Library Configuration Console.
To be thread safe
To ensure that the backing store remains intact if an exception occurs while it is being accessed
To make sure that the states of the in-memory cache and the backing store remain synchronized
Design Highlights
Figure 1 shows the interrelationships between the key classes in the Caching Application Block.
When you initialize an instance of the CacheManager using the CacheFactory, it internally creates a
CacheManagerFactory object, which in turn creates a Cache object. After the Cache object is created,
all data in the backing store is loaded into an in-memory representation that is contained in the Cache
object. Applications can then make requests to the CacheManager object to retrieve cached data, add
data to the cache, and remove data from the cache.
When an application uses the GetData method to send a request to the CacheManager object to retrieve
an item, the CacheManager object forwards the request to the Cache object. If the item is in the cache,
it is returned from the in-memory representation in the cache to the application. If it is not in the cache,
the request returns NULL. If the item is in the cache but expired, the item also returns NULL.
When an application uses the Add method to send a request to the CacheManager object to add an item
to the cache, the CacheManager object again forwards the request to the Cache object. If there is
already an item with the same key, the Cache object first removes it before adding the new item to the
in-memory store and the backing store. If the backing store is the default backing store,
NullBackingStore, the data is written only to memory. If the number of cached items exceeds a
predetermined limit when the item is added, the BackgroundScheduler object begins scavenging. When
adding an item, the application can use an overload of the Add method to specify an array of expiration
policies, the scavenging priority, and an object that implements the ICacheItemRefreshAction
interface. This object can be used to refresh an expired item from the cache.
The BackgroundScheduler object periodically monitors the lifetime of items in the cache. When an
item expires, the BackgroundScheduler object first removes it and then, optionally, notifies the
application that the item was removed. At this point, it is the responsibility of the application to refresh
the cache.
Test Drive
The Caching Application Block has been developed as a result of analyzing common enterprise
development challenges and successful solutions to these challenges. However, because each
application is unique, you will not find this application block suitable for every application. To evaluate
this application block and determine its applicability to your projects, Microsoft suggests you dedicate
at least half of a day to explore the application block. The following is a suggested evaluation
approach:
Download Enterprise Library.
Install Enterprise Library and compile all application blocks and tools.
Read the "Introduction" and "Scenarios and Goals" sections of the documentation.
Compile and run the QuickStart samples, and read through the related "QuickStart Walkthroughs" and
"Key Scenarios" sections of the documentation.
If the application block looks like a good fit for your application, try implementing a simple use case in
your application or in a throw-away prototype application using the application block.
Community
This application block, like other patterns & practices deliverables, is associated with a community
site. On this community site, you can post questions, provide feedback, or connect with other users for
sharing ideas. Community members can also help Microsoft plan and test future application blocks,
and download additional content such as extensions and training materials.
Roadmap
An updated release of the Caching Application Block is planned for the next release of Enterprise
Library. That release will target the .NET Framework 2.0 and Visual Studio 2005.
The Caching Application Block will be updated to work with the .NET Framework 2.0 and may
include additional improvements based on customer feedback.
Development: Scott Densmore, Peter Provost (Microsoft Corporation), Brian Button (Murphy and
Associates)
Test: Mohammad Al-Sabt, Carlos Farre (Microsoft Corporation), Rohit Sharma, Mani Krishnaswami,
Prashant Bansode (Infosys Technologies Ltd)
Documentation and Samples: RoAnn Corbisier (Microsoft Corporation), Tim Osborn (Ascentium
Corporation), Roberta Leibovitz (Modeled Computation LLC), Paul Slater (Wadeware LLC), Tina
Burden McGrayne (Linda Werner & Associates Inc)
Many thanks to the following advisors who provided invaluable assistance:
Rudy Araujo, Yen-Ming Chen, Mark Curphey and David Raphael of Foundstone Inc.
Benoit Morneau and Shoichi Takasaki of Bowne Global Solutions
Related Titles
Caching Architecture Guide for .NET Framework Applications
Enterprise Library
Downloads
The latest release of Configuration Application Block is included as a part of the patterns & practices
Enterprise Library, January 2005. To learn about and download Enterprise Library, use the following
links:
Enterprise Library home page
Download Enterprise Library, January 2005
The terms of use of Enterprise Library are specified in the End User Licensing Agreement (EULA).
You can also download an earlier version, named the Configuration Management Application Block,
from the Microsoft Download Center's Configuration Management Application Block Web page.
Contents
Introduction to the Configuration Application Block
Design of the Configuration Application Block
Test Drive
Community
Feedback and Support
Roadmap
Authors and Contributors
Related Titles
Specifically, the Configuration Application Block provides a flexible data model, a simple method for
retrieving configuration data, and extensibility.
The Configuration Application Block decouples the ability to read and write configuration data from
the specifics of the underlying data store. It does this by using storage providers and transformers to
transfer data between the application and the physical store. Storage providers are objects that can read
or write to a particular physical store, such as an XML file or a SQL database. Transformers translate
the configuration information between the form the application expects (for example a set of objects)
and the form the storage provider requires (for example an XML document). The application block is
packaged with an XML file storage provider and an XML serializer transformer.
You define the storage provider and transformer in a file that contains configuration metadata.
Typically, this file is either the Machine.config file, the App.config file, or the Web.config file. The
metadata includes information such as the name of the configuration section, the storage location, and
the type names of the objects to be used when reading or writing configuration settings. This means
that you can change from one type of store to another by changing the information in the file. There is
no need to rewrite your application.
Similarly, you can change the attributes of your store, such as its location, by changing the same file.
Again, there is no need to modify your application code. Deciding where to store configuration data
can be done during deployment and operation.
Common Scenarios
The Configuration Application Block provides a simple interface for reading and writing application
configuration data. Retrieving configuration data requires only a single line of code. The following
example retrieves a database connection string from the configuration file.
[C#]
string conString = (string)ConfigurationManager.GetConfiguration("connectionstring");
[Visual Basic]
Dim conString As String = ConfigurationManager.GetConfiguration("connectionstring")
You can extend the Configuration Application Block by creating custom storage providers that allow
you to use other data stores, such as the Windows registry or a SQL database. You add these custom
providers to the Configuration Application Block by changing the configuration metadata file. You do
not need to modify or rebuild the Configuration Application Block to use different stores. You can also
add custom transformers to translate the configuration data for the application and for the store.
Audience Requirements
This application block is intended for software architects and software developers. To benefit fully
from this guidance, you should have an understanding of the following technologies:
Microsoft Visual C# development tool or Microsoft Visual Basic development system
.NET Framework
Highlights of Version 1.0 Release
The Enterprise Library Configuration Application Block, version 1.0, uses the Enterprise Library
Configuration Console to manage configuration settings. It also lets you add your own storage
providers and transformers.
Migrating from the Configuration Management Application Block
There are significant differences between the Enterprise Library Configuration Application Block,
version 1.0, and the Configuration Management Application Block:
This version of the application block includes support for storing configuration data in XML files. If
you have used other types of data stores, such as the Windows registry or a SQL database, you can
either create a custom storage provider and transformer, or you can convert your data to XML.
There is no longer support for using name/value pairs to represent configuration data or for hash table
serialization. To read configuration data into your application or to write it to a configuration file, you
declare a class that will contain the data. This class should be able to use the output of the transformer.
System Requirements
To develop application blocks using the Configuration Application Block, you need the following:
Microsoft Windows 2000, Windows XP Professional, or Windows Server 2003 operating system
Microsoft .NET Framework 1.1
Microsoft Visual Studio .NET 2003
Configuration Application Block Dependencies
The Configuration Application Block depends on code included in the Enterprise Library, including
common library functionality, such as instrumentation, which provides various functions for exposing
events and data used for system management.
In addition, the application block uses XML files to store configuration information. The recommended
way to modify this information is to use the Enterprise Library Configuration Console.
The Configuration Application Block separates configuration metadata from the actual configuration
settings. The application block places the metadata in its own file separate from the location where the
configuration settings are stored. Configuration settings are grouped together and referred to as a
configuration section. Each Enterprise Library application block that your application uses has its own
configuration section that is stored in its own file. The Configuration Application Block accesses the
data in a configuration by using the configuration metadata.
The metadata points to the configuration storage location and contains information such as the type of
transformer and storage provider that the Configuration Application Block needs to read and to write
the configuration data. The configuration metadata file is divided into sections. Each section contains
the information that is required to read and write a particular group of configuration settings from and
to a configured storage location.
The ConfigurationManager class provides a static facade to read and write configuration settings for
a specified configuration section in a defined storage location. The ConfigurationManager object
reads configuration metadata from the application domain configuration file and uses that information
to read and write the configuration section information.
The static methods of the ConfigurationManager class use an instance of a ConfigurationBuilder
object. The ConfigurationBuilder creates the file storage provider and the transformer objects. These
objects manage the configuration data and metadata.
The IStorageProviderReader interface defines the interface that is used to read configuration
information from a storage location. The IStorageProviderWriter interface implements the
IStorageProviderReader interface and also defines the interface that is used to write configuration
information. The Configuration Application Block includes one provider that supports this interface,
XmlFileStorageProvider, which reads and writes configuration data to an XML file.
The ITransformer interface transforms configuration settings objects between the application and the
storage provider. The Configuration Application Block includes one provider, the
XmlSerializerTransformer class, which implements this interface. The XmlSerializerTransformer
class translates between application-defined run-time objects and XmlNode objects. Applications are
not required to configure a transformer. If there is no transformer, configuration settings objects are
returned to the application in the same form as provided by the storage provider.
The settings for each configuration section are cached in a hash table. When the client requests
configuration data, the ConfigurationBuilder object looks for the data in the cache. If the
configuration data is found in the cache, the ConfigurationBuilder object does not access the
configuration data that is in storage. The ConfigurationBuilder object clears the cache if the file
storage provider detects that configuration data has changed in storage. The ConfigurationManager
object allows applications to clear the cache, either entirely or for only a given section name. If the
cache is cleared, the next read operation accesses the configuration settings from the storage location.
In summary, the Configuration Application Block is designed so that you can store configuration data
in your application in whatever way best suits the application's requirements. You are not constrained
by the storage method. The IStorageProviderReader and IStorageProviderWriter interfaces and,
optionally, the ITransformer interface, decouple the in-memory representation from the representation
that is used in the physical store.
Test Drive
The Configuration Application Block has been developed as a result of analyzing common enterprise
development challenges and successful solutions to these challenges. However, because each
application is unique, you will not find this application block suitable for every application. To evaluate
this application block and determine its applicability to your projects, Microsoft suggests you dedicate
at least half of a day to explore the application block. The following is a suggested evaluation
approach:
Download Enterprise Library.
Install Enterprise Library and compile all application blocks and tools.
Read the "Introduction" section of the documentation.
Compile and run the QuickStart samples, and read through the related "QuickStart Walkthroughs" and
"Key Scenarios" sections of the documentation.
If the application block looks like a good fit for your application, try implementing a simple use case in
your application or in a throw-away prototype application using the application block.
Community
This application block, like other patterns & practices deliverables, is associated with a community
site.
On this community site, you can post questions, provide feedback, or connect with other users for
sharing ideas. Community members can also help Microsoft plan and test future application blocks,
and download additional content such as extensions and training materials.
Roadmap
An updated release of the Configuration Application Block is planned for the next release of Enterprise
Library. This release will target the .NET Framework 2.0 and Visual Studio 2005.
The Configuration Application Block will be updated to work with the .NET Framework 2.0 and may
include additional improvements based on customer feedback.
Related Titles
Enterprise Library
Downloads
The latest release of Data Access Application Block is included as a part of the patterns & practices
Enterprise Library, January 2005. To learn about and download Enterprise Library, use the following
links:
Enterprise Library home page
Download Enterprise Library, January 2005
The terms of use of Enterprise Library are specified in the End User Licensing Agreement (EULA).
You can also download earlier releases of the Data Access Application Block:
Data Access Application Block 2.0
Data Access Application Block 1.0
Contents
Introduction to the Data Access Application Block
Design of the Data Access Application Block
Test Drive
Community
Feedback and Support
Roadmap
Authors and Contributors
Related Titles
A factory and named instances that abstract the database and the connection string, respectively
Support for parameter caching has been expanded to allow applications to clear the cache
Migrating from Previous Versions of the Data Access Application Block
Users of earlier releases of the Data Access Application Block should recognize many of the scenarios
addressed by the Enterprise Library version. While the current version builds on the knowledge and
feedback gained from earlier releases, it represents a significant change in how those scenarios are
addressed.
The following list describes the changes between the Enterprise Library version of the Data Access
Application Block and earlier versions:
The static helper methods available in the earlier versions of the application block have been replaced
by methods on instantiated data access objects.
Another style of overloads that accepts new data access objects is now provided. When using this style,
all data access functionality is exposed through two overloads, one to use when executing commands
outside of a transaction and another to use when executing commands inside of a transaction.
The numerous overloads for each data access method have been reduced.
The database-specific object is created with a factory, which uses configuration information to
determine the type of object to create.
Connection string information has been moved to a configuration file and is no longer used on the
method calls. Using the Enterprise Library Configuration Console allows you to configure your
databases, and if needed, encrypt the configuration information in storage.
A separate class now represents command information. Developers create and initialize a command
object, which is then passed to the appropriate method in the Database class.
The following code illustrates an application using the Data Access Application Block to perform a
database query that returns a dataset.
[C#]
myDataSet =
DatabaseFactory.CreateDatabase(“Sales”).ExecuteDataSet("GetOrdersByCustomer",
myCustomerId );
[VB]
myDataSet = DatabaseFactory.CreateDatabase("Sales").ExecuteDataSet("GetOrdersByCustomer",
myCustomerId);
Notice that the code the developer writes references the database by name. The actual database type
and connection string are stored in the configuration.
System Requirements
To develop applications using the Data Access Application Block, you need the following:
Microsoft Windows 2000, Windows XP Professional, or Windows Server 2003 operating system
Microsoft .NET Framework 1.1
Microsoft Visual Studio .NET 2003
A database server running SQL Server 7.0 or later, Oracle 9i, or DB2 (If you are using a DB2 database,
you also need the IBM UDB 8.1.2 data provider)
Data Access Application Block Dependencies
The application blocks that are provided with the Enterprise Library are designed to be used in
conjunction with each other. Sometimes, the application blocks have dependencies on other application
blocks and code that is included with the Enterprise Library. The Data Access Application Block has
the following dependencies:
The Configuration Application Block. The Data Access Application Block uses the Configuration
Application Block to read its configuration information.
Common library functionality, such as instrumentation. It provides various functions for exposing
events and data used for system management.
By default, the application block uses XML files to store configuration information. The recommended
way to modify this information is to use the Enterprise Library Configuration Console.
You can use the Enterprise Library Configuration Console to encrypt and protect the database
configuration information containing connection strings. Connection strings may contain passwords,
network addresses, and other sensitive information. To learn more about encrypting configuration
settings, see the documentation for the Enterprise Library Configuration Application Block.
The abstract base class Database defines the common interface and provides much of the
implementation for the data access methods. The SqlDatabase, OracleDatabase and Db2Database
classes derive from the Database class.
They provide methods to their respective database server systems, which include common functionality
that is implemented differently from database to database, as well as functionality unique to that
database system.
Database commands and parameters are handled differently across database systems. The abstract class
DbCommandWrapper provides the interface definition for database-specific classes that will wrap
IDbCommand and provide parameter handling.
The DatabaseFactory class provides a static method, CreateDatabase, to encapsulate the logic that
creates the appropriate Database object. By using the factory to create the correct database object, the
client code is not bound to a specific database type.
The DatabaseFactory class uses the Configuration Application Block to retrieve the required
configuration information, including the fully qualified type name and the connection string of the
specific Database-derived class to be created.
The application block supports the dynamic discovery of parameters. This discovery requires a round
trip to the database system. The ParameterCache class allows parameter information to be cached,
thus avoiding round trips for subsequent invocations of the same stored procedure.
Test Drive
The Data Access Application Block has been developed as a result of analyzing common enterprise
development challenges and successful solutions to these challenges. However, because each
application is unique, you will not find this application block suitable for every application. To evaluate
this application block and determine its applicability to your projects, Microsoft suggests you dedicate
at least half of a day to explore the application block. The following is a suggested evaluation
approach:
Download Enterprise Library.
Install Enterprise Library and compile all application blocks and tools.
Read the "Introduction" and "Scenarios and Goals" sections of the documentation.
Run the scripts to configure the application block's QuickStart samples.
Compile and run the QuickStart samples, and read through the related "QuickStart Walkthroughs" and
"Key Scenarios" sections of the documentation
If the application block looks like a good fit for your application, try implementing a simple use case in
your application or in a throw-away prototype application using the application block.
Community
This application block, like other patterns & practices deliverables, is associated with a community
site. On this community site, you can post questions, provide feedback, or connect with other users for
sharing ideas. Community members can also help Microsoft plan and test future application blocks,
and download additional content such as extensions and training materials.
Roadmap
An updated release of the Data Access Application Block is planned for the next release of Enterprise
Library. This release will target the .NET Framework 2.0 and Visual Studio 2005.
The Data Access Application Block will be updated to work with the .NET Framework 2.0 and may
include additional improvements based on customer feedback.
Related Titles
.NET Data Access Architecture Guide
Enterprise Library
Downloads
This release of Cryptography Application Block is included as a part of the patterns & practices
Enterprise Library, January 2005. To learn about and download Enterprise Library, use the following
links:
Enterprise Library home page
Download Enterprise Library, January 2005
The terms of use of Enterprise Library are specified in the End User Licensing Agreement (EULA).
Contents
Introduction to the Cryptography Application Block
Design of the Cryptography Application Block
Test Drive
Community
Feedback and Support
Roadmap
Authors and Contributors
Related Titles
Common Scenarios
Developers frequently write applications that require encryption and hashing capabilities to meet the
security requirements of their organization. Data that is created and maintained by applications, as well
as configuration information, often needs to be encrypted. Additionally, passwords that are used to
access application functionality or data need to be hashed.
The Cryptography Application Block simplifies the work of developers by abstracting application code
from specific cryptography providers. You can change underlying providers through configuration
changes without changing the underlying application code. It also encapsulates best-practice
implementation of common challenges associated with cryptography such as encrypting and persisting
cryptographic keys.
Audience Requirements
This guide is intended for software architects and software developers. To benefit fully from this guide,
you should have an understanding of the following technologies:
Microsoft Visual C# development tool or Microsoft Visual Basic development system
.NET Framework (including .NET Framework cryptography concepts)
Highlights of Version 1.0 Release
The Enterprise Library Cryptography Application Block, version 1.0, includes the following new
features:
A graphical tool for managing configuration settings
Two implementations of a hash provider
A small number of methods that simplify the most common cryptography tasks
System Requirements
The requirements for the Cryptography Application Block are the following:
Microsoft Windows 2000, Windows XP Professional, or Windows Server 2003 operating system
Microsoft .NET Framework version 1.1
Microsoft Visual Studio .NET 2003
Cryptography Application Block Dependencies
The application blocks that are provided with the Enterprise Library are designed to be used in
conjunction with each other. Sometimes, the application blocks have dependencies on other application
blocks and code that is included with the Enterprise Library. The Cryptography Application Block has
the following dependencies:
The Configuration Application Block. The Cryptography Application Block uses the Configuration
Application Block to read its configuration information, and to ensure that the keys that are used for
encryption are themselves encrypted.
Common library functionality, such as instrumentation. It provides various functions for exposing
events and data used for system management. It also provides classes that help with the correct use of
DPAPI.
In addition, the application block uses XML files to store configuration information. The recommended
way to modify this information is to use the Enterprise Library Configuration Console.
The Cryptography Application Block is designed to externalize all decisions about how to deal with
cryptography from a running application. This design lets you change cryptography behavior without
changing the code of the application.
Test Drive
The Cryptography Application Block has been developed as a result of analyzing common enterprise
development challenges and successful solutions to these challenges. However, because each
application is unique, you will not find this application block suitable for every application. To evaluate
this application block and determine its applicability to your projects, Microsoft suggests you dedicate
at least half of a day to explore the application block. The following is a suggested evaluation
approach:
Download Enterprise Library.
Install Enterprise Library and compile all application blocks and tools.
Read the "Introduction" and "Scenarios and Goals" sections of the documentation.
Compile and run the QuickStart samples, and read through the related "QuickStart Walkthroughs" and
"Key Scenarios" sections of the documentation.
If the application block looks like a good fit for your application, try implementing a simple use case in
your application or in a throw-away prototype application using the application block.
Community
This application block, like other patterns & practices deliverables, is associated with a community
site. On this community site, you can post questions, provide feedback, or connect with other users for
sharing ideas. Community members can also help Microsoft plan and test future application blocks,
and download additional content such as extensions and training materials.
Roadmap
An updated release of the Cryptography Application Block is planned for the next release of Enterprise
Library. This release will target the .NET Framework 2.0 and Visual Studio 2005.
The Cryptography Application Block will be updated to work with the .NET Framework 2.0 and may
include additional improvements based on customer feedback.
Related Titles
Enterprise Library
Downloads
The latest release of Exception Handling Application Block is included as a part of the patterns &
practices Enterprise Library, January 2005. To learn about and download Enterprise Library, use the
following links:
Enterprise Library home page
Download Enterprise Library, January 2005
The terms of use of Enterprise Library are specified in the End User Licensing Agreement (EULA).
You can also download an earlier version, named the Exception Management Application Block, from
the Microsoft Download Center's Exception Management Application Block Web page.
Contents
Introduction to the Exception Handling Application Block
Design of the Exception Handling Application Block
Test Drive
Community
Feedback and Support
Roadmap
Authors and Contributors
Related Titles
Figure 1 shows the interrelationships between the key classes in the Exception Handling Application
Block.
Test Drive
The Exception Handling Application Block has been developed as a result of analyzing common
enterprise development challenges and successful solutions to these challenges. However, because each
application is unique, you will not find this application block suitable for every application. To evaluate
this application block and determine its applicability to your projects, Microsoft suggests you dedicate
at least half of a day to explore the application block. The following is a suggested evaluation
approach:
Download Enterprise Library.
Install Enterprise Library and compile all application blocks and tools.
Read the "Introduction" and "Scenarios and Goals" sections of the documentation.
Compile and run the QuickStart samples, and read through the related "QuickStart Walkthroughs" and
"Key Scenarios" sections of the documentation.
If the application block looks like a good fit for your application, try implementing a simple use case in
your application or in a throw-away prototype application using the application block.
Community
This application block, like other patterns & practices deliverables, is associated with a community
site. On this community site you can post questions, provide feedback, or connect with other users for
sharing ideas. Community members can also help Microsoft plan and test future application blocks,
and download additional content such as extensions and training materials.
Roadmap
An updated release of the Exception Handling Application Block is planned for the next release of
Enterprise Library. This release will target the .NET Framework 2.0 and Visual Studio 2005.
The Exception Handling Application Block will be updated to work with the .NET Framework 2.0 and
may include additional improvements based on customer feedback.
Related Titles
Exception Management Architecture Guide
Enterprise Library
Downloads
The latest release of Logging and Instrumentation Application Block is included as a part of the
patterns & practices Enterprise Library, January 2005. To learn about and download Enterprise
Library, use the following links:
Enterprise Library home page
Download Enterprise Library, January 2005
The terms of use of Enterprise Library are specified in the End User Licensing Agreement (EULA).
You can also download the earlier version, named the Logging Application Block, from the Microsoft
Download Center's Logging Application Block Web page.
Contents
Introduction to the Logging and Instrumentation Application Block
Design of the Logging and Instrumentation Application Block
Test Drive
Community
Feedback and Support
Roadmap
Authors and Contributors
Related Titles
Key differences between the Enterprise Library version of the Logging and Instrumentation
Application Block and the Logging Application Block include the following:
It no longer has any dependencies on the Enterprise Instrumentation Framework (EIF).
It uses formatters that are defined in the Enterprise Library Configuration Console instead of creating
specific XSLT files.
It no longer provides a Trace Log event sink.
It no longer supports multiple formatters that are chained together. Instead, all the formatting
information is contained in a single formatter.
It no longer provides an encryption formatter.
System Requirements
To use the Logging and Instrumentation Application Block, you need the following:
Microsoft Windows 2000, Windows XP Professional, or Windows Server 2003 operating system
Microsoft .NET Framework version 1.1
Microsoft Visual Studio .NET 2003 Enterprise Architect, Enterprise Developer, or .NET Professional
edition
Stores to maintain log messages (exactly what is required depends on the specific event sinks you use)
Logging and Instrumentation Application Block Dependencies
The Enterprise Library application blocks are designed to be used in conjunction with each other. In
some cases, the application blocks have dependencies on other application blocks and code included in
the Enterprise Library. The Logging and Instrumentation Application Block has dependencies on the
following:
The Configuration Application Block. The Logging and Instrumentation Application Block uses this
to read its configuration information.
Common library functionality, such as instrumentation. This provides various functions for
exposing events and data that are used for system management.
Depending on the specific functionality you require from the Logging and Instrumentation Application
Block, you may also require the Data Access Application Block, which the Logging and
Instrumentation Application Block uses for the database event sink.
The application block uses XML files to store configuration information. The recommended way to
modify this information is to use the Enterprise Library Configuration Console.
Figure 1 illustrates the design of the Logging and Instrumentation Application Block.
The Logging and Instrumentation Application Block is designed to externalize all decisions about how
to deal with events from a running application. This design lets you change logging behavior without
changing the code of the application.
Test Drive
The Logging and Instrumentation Application Block has been developed as a result of analyzing
common enterprise development challenges and successful solutions to these challenges. However,
because each application is unique, you will not find this application block suitable for every
application. To evaluate this application block and determine its applicability to your projects,
Microsoft suggests you dedicate at least half of a day to explore the application block. The following is
a suggested evaluation approach:
Download Enterprise Library.
Install Enterprise Library and compile all application blocks and tools.
Read the "Introduction" and "Scenarios and Goals" sections of the documentation.
Compile and run the QuickStart samples, and read through the related "QuickStart Walkthroughs" and
"Key Scenarios" sections of the documentation.
If the application block looks like a good fit for your application, try implementing a simple use case in
your application or in a throw-away prototype application using the application block.
Community
This application block, like other patterns & practices deliverables, is associated with a community
site. On this community site, you can post questions, provide feedback, or connect with other users for
sharing ideas. Community members can also help Microsoft plan and test future application blocks,
and download additional content such as extensions and training materials.
Roadmap
An updated release of the Logging and Instrumentation Application Block is planned for the next
release of Enterprise Library. This release will target the .NET Framework 2.0 and Visual Studio 2005.
The Logging and Instrumentation Application Block will be updated to work with the .NET
Framework 2.0 and may include additional improvements based on customer feedback.
Related Titles
Exception Management Architecture Guide
Enterprise Library
Downloads
The latest release of Security Application Block is included as a part of the patterns & practices
Enterprise Library, January 2005. To learn about and download Enterprise Library, use the following
links:
Enterprise Library home page
Download Enterprise Library, January 2005
The terms of use of Enterprise Library are specified in the End User Licensing Agreement (EULA).
You can also download an earlier application block, named the Authorization and Profile Application
Block, from the Microsoft Download Center's Authorization and Profile Application Block Web page.
The Authorization and Profile Application Block includes a subset of the Security Application
Block’s functionality.
Contents
Introduction to the Security Application Block
Design of the Security Application Block
Test Drive
Community
Feedback and Support
Roadmap
Authors and Contributors
Related Titles
The Security Application Block is an enhancement of an earlier application block, named the
Authorization and Profile Application Block. This release of the Security Application Block includes a
number of features not contained in the Authorization and Profile Application Block. These features
include the following:
Authentication support
Authorization without the requirement for Authorization Manager
Caching of security related credentials
Additional providers
Migrating from the Authorization and Profile Application Block
Users of the Authorization and Profile Application Block should recognize many of the scenarios
addressed by the Enterprise Library Security Application Block. The current version builds on the
knowledge and feedback gained from earlier releases, and it represents a significant change in how
those scenarios are addressed.
Some of the key differences between the Enterprise Library version of the Security Application Block
and the Security and Profile Application Block include the following:
The Enterprise Library Security Application Block includes functionality to assist with authentication.
The Authorization and Profile Application Block did not include any functionality to implement
authentication.
Instead of calling provider managers, developers now call methods on factory classes. These classes
are consistent across the different areas of functionality of the application block.
Instead of using an Extended Principal with additional methods, the methods are supplied with the
providers. This allows you to use them with custom IPrincipal implementations.
System Requirements
The requirements for the Security Application Block are the following:
Microsoft Windows 2000, Windows XP Professional, or Windows Server 2003 operating system
Microsoft .NET Framework version 1.1
Microsoft Visual Studio .NET 2003
Stores to maintain data used for authentication, authorization, profile, and role information (exact
requirements depend on how you use the application block)
A store to cache security information (required only if you use the caching functionality of the
application block)
One or more authorization stores to maintain authorization data (if you are going to use the application
block for authorization)
Note If you use the Authorization Manager provider, it requires Microsoft Windows 2000 Server with
Service Pack 4 or Microsoft Windows Server 2003.
Security Application Block Dependencies
The Enterprise Library Application Blocks are designed to be used in conjunction with each other.
Sometimes, the application blocks have dependencies on other application blocks and code that is
included with the Enterprise Library. The Security Application Block has the following dependencies:
The Configuration Application Block. The Security Application Block uses it to read its
configuration information.
Common library functionality, such as instrumentation. This provides various functions for
exposing events and data used for system management.
Depending on the specific functionality you require from the Security Application Block, you may also
require one or both of the following application blocks contained in the Enterprise Library:
The Data Access Application Block. The database providers of the Security Application Block use
the Data Access Application Block to access security information contained in a database.
The Caching Application Block. The Security Application Block uses the Caching Application Block
to cache security information and then retrieve it when required.
By default, the application block uses XML files to store configuration information. You can modify
this configuration information to change the behavior of the application block. The recommended way
to modify this information is to use the Enterprise Library Configuration Console.
The actual security information (authorization data, authentication stores and profile information) is
managed by the providers of the respective areas of the application block.
Test Drive
The Security Application Block has been developed as a result of analyzing common enterprise
development challenges and successful solutions to these challenges. However, because each
application is unique, you will not find this application block suitable for every application. To evaluate
this application block and determine its applicability to your projects, Microsoft suggests you dedicate
at least half of a day to explore the application block. The following is a suggested evaluation
approach:
Community
This application block, like other patterns & practices deliverables, is associated with a community
site. On this community site, you can post questions, provide feedback, or connect with other users for
sharing ideas. Community members can also help Microsoft plan and test future application blocks,
and download additional content such as extensions and training materials.
Roadmap
An updated release of the Security Application Block is planned for the next release of Enterprise
Library. This release will target the .NET Framework 2.0 and Visual Studio 2005.
The Security Application Block will be updated to work with the .NET Framework 2.0 and may
include additional improvements based on customer feedback.
Related Titles
Exception Management Architecture Guide
Improving Web Application Security: Threats and Countermeasures
Enterprise Library