Seven Microsoft Application Blocks in One Neat Little Package

Seven Microsoft Application Blocks in One Neat Little Package

he problem with developing enterprise applications is you have to reinvent the wheel for each key area, such as configuration, database access, or security. Microsoft has addressed this problem in the past by providing application building blocks. However, one of the biggest problems with these application blocks was they were not very well integrated with each other. So, Microsoft’s Pattern & Practices Group has released the Enterprise Library, a large configurable and extensible software library that consists of seven integrated application blocks.

What You Need:
* Visual Studio .NET 2003
* Enterprise Library

You may already be familiar with the individual application blocks that the Enterprise Library contains (like the Data Access Application Block), but it also offers some new ones (like the Cryptography Application Block). Table 1 describes the application blocks within the Enterprise Library.

Application Block Description
Caching Application Block Enables you to integrate a caching mechanism in your application
Configuration Application Block Provides an extensible API for the configuration of your application (The Enterprise Library also provides you a GUI to configure your application.)
Data Access Application Block Enables you to implement a very consistent data-access strategy in your application or your enterprise
Cryptography Application Block Enables you to encrypt sensitive information
Exception Handling Application Block Provides a consistent and configurable approach for exception-handling strategies in your applications
Logging and Instrumentation Application Block Enables you to trace and log the internal runtime details of your application
Security Application Block Provides authentication and authorization features for your applications
Table 1. The Application Blocks Within the Enterprise Library

Figure 1. The Enterprise Library’s Graphical Configuration Tool

The Enterprise Library offers the following benefits:

  • You can use the Enterprise Library as the basis for your own application blocks by using its extensible (provider-based) development model and the graphical configuration tool, the Configuration Console (see Figure 1).
  • Through its standard interfaces, you can customize the Enterprise Library to suit your development.
  • The Enterprise Library ships with the entire source code, which you can alter without any restrictions.
  • You can use each application block as a standalone. You need only reference the Configuration Application Block to use any of the others in the Enterprise Library.
  • The Enterprise Library consists of several hundred pages of documentation, samples, and walkthroughs that teach you about the architecture and design of extensible application frameworks.

Configuration Made Easy

The Enterprise Library ships with the Configuration Console (see Figure 1), a graphical user interface (GUI) through which you can configure your applications and the Enterprise Library itself. So you don’t have to directly edit large, complicated XML configuration files to make changes. This support enables administrators to make configuration changes as well as developers, because they don’t need to know anything about the XML structure of configuration files.

Each application block provides a set of several interfaces called providers that allow you to extend the Enterprise Library’s functionality in various ways. For example, you can extend the Caching Application Block with a user-defined backend storage provider, which defines where you want to store cached data in your application. Such a user-defined provider also can be configured through the Configuration Console.

The Design of the Enterprise Library

To consolidate existing application blocks into one library, Microsoft had to make some critical design decisions. One such decision was that no application block should have a dependency on another, except the Configuration Application Block. Figure 2 shows the relationship between the application blocks.

Figure 2. Relationship Between the Application Blocks

This design enables you to use each application block on its own. As I previously mentioned, the only requirement is a reference to the Configuration Application Block. The reason for this is that each application block has configuration files that must be maintained (through the Configuration Console). Furthermore, the Enterprise Library has an assembly called Common that also must be referenced within your solution. This assembly provides functionality that each application block uses. Cryptography functionality is also implemented in this assembly. So you don’t have to use the Cryptography Application Block when you want to encrypt settings in a configuration file.

Extensibility Points and Custom Application Blocks

Each application block is based on a provider model, where you can extend the library in several ways. You also can plug in your own custom application block. When you write components or providers to extend the Enterprise Library, you must follow a simple set of predefined policies so that you don’t break any of Microsoft’s design implementations. The first policy is that each application block should contain a very simple API with which the developer can interact. This API should be designed in a way that it is independent from the internal implementation. In other words, when you change something within your own application block, the public API should not change.

Another very important policy is that each application block should provide extensibility points (based on providers) where you can plug in your own functionality. The Security Application Block, for example, offers some providers where you can choose and define where your security objects (users, roles) are stored. The Enterprise Library provides a provider for a database or for Active Directory as well. If you are storing users and roles in a LDAP directory, you can implement your own provider and configure and use it through the Enterprise Library.

When you integrate your own application block into the Enterprise Library, you should also equip it with logging and instrumentation code. You also should provide some meaningful performance counters since each application block provides some performance counters that can be monitored through the Performance monitor.

If your own application block needs functionality from another application block, consider decoupling the connection points between the two blocks. You can use a provider-based model to achieve the necessary decoupling between the components. This way, you give developers the chance to replace external dependencies with their own functionality and features.

When you have to store configuration information, use the Configuration Application Block. Your own application block will depend on this application block anyway. Also, the Configuration Application Block is very configurable and extensible. You can use the Configuration Console to configure all the necessary aspects and settings throughout your application.

Compiling the Enterprise Library

Because the Enterprise Library ships with source code, you must compile it to use it. The compilation can be started automatically during installation. All assemblies and tools are placed in the C:Program FilesMicrosoft Enterprise Libraryin directory. From this directory, you can reference any assembly you need in your project. The Enterprise Library provides two ways to compile the assemblies after installation: a batch file and a Visual Studio .NET 2003 solution. If you want to build it with batch files, you have three options:

  • BuildLibrary.bat: compiles the whole Enterprise Library with all needed tools
  • CopyAssemblies.bat: copies the newly compiled assemblies in the bin directory
  • InstallServices.bat: installs Windows Services, which the Logging and Instrumentation Building Block needs

The other option, a Visual Studio .NET 2003 solution, provides the build configurations described in Table 2.

Build Configuration Description
Debug The standard debug build configuration (Unit tests are not compiled.)
DebugUnitTests Compiles the most important unit tests with debug symbols that can help you during debugging
DebugLongRunningTests Compiles all available unit tests
Release The standard release configuration (Unit tests are not compiled.)
ReleaseUnitTests Compiles the most important unit tests as an optimized release version
ReleaseFinal Interprets each warning as an error
Table 2. Build Configurations for Visual Studio .NET 2003 Solution

All assemblies created through the build process are unsigned. Therefore, they don’t have strong names. So you can’t place them into the Global Assembly Cache (GAC) for common sharing purposes. If you want to do this, you must sign them with your own provided key.

Integrated, Configurable, and Extensible

Each application block within the Enterprise Library is very well integrated with the others, enabling you to combine them in a very efficient way. You also can extend the Enterprise Library with your own providers or implement your own application block, which you can seamlessly integrate into the Enterprise Library as well.



Share the Post:
5G Innovations

GPU-Accelerated 5G in Japan

NTT DOCOMO, a global telecommunications giant, is set to break new ground in the industry as it prepares to launch a GPU-accelerated 5G network in

AI Ethics

AI Journalism: Balancing Integrity and Innovation

An op-ed, produced using Microsoft’s Bing Chat AI software, recently appeared in the St. Louis Post-Dispatch, discussing the potential concerns surrounding the employment of artificial

Savings Extravaganza

Big Deal Days Extravaganza

The highly awaited Big Deal Days event for October 2023 is nearly here, scheduled for the 10th and 11th. Similar to the previous year, this

5G Innovations

GPU-Accelerated 5G in Japan

NTT DOCOMO, a global telecommunications giant, is set to break new ground in the industry as it prepares to launch a GPU-accelerated 5G network in Japan. This innovative approach will

AI Ethics

AI Journalism: Balancing Integrity and Innovation

An op-ed, produced using Microsoft’s Bing Chat AI software, recently appeared in the St. Louis Post-Dispatch, discussing the potential concerns surrounding the employment of artificial intelligence (AI) in journalism. These

Savings Extravaganza

Big Deal Days Extravaganza

The highly awaited Big Deal Days event for October 2023 is nearly here, scheduled for the 10th and 11th. Similar to the previous year, this autumn sale has already created

Cisco Splunk Deal

Cisco Splunk Deal Sparks Tech Acquisition Frenzy

Cisco’s recent massive purchase of Splunk, an AI-powered cybersecurity firm, for $28 billion signals a potential boost in tech deals after a year of subdued mergers and acquisitions in the

Iran Drone Expansion

Iran’s Jet-Propelled Drone Reshapes Power Balance

Iran has recently unveiled a jet-propelled variant of its Shahed series drone, marking a significant advancement in the nation’s drone technology. The new drone is poised to reshape the regional

Solar Geoengineering

Did the Overshoot Commission Shoot Down Geoengineering?

The Overshoot Commission has recently released a comprehensive report that discusses the controversial topic of Solar Geoengineering, also known as Solar Radiation Modification (SRM). The Commission’s primary objective is to

Remote Learning

Revolutionizing Remote Learning for Success

School districts are preparing to reveal a substantial technological upgrade designed to significantly improve remote learning experiences for both educators and students amid the ongoing pandemic. This major investment, which

Revolutionary SABERS Transforming

SABERS Batteries Transforming Industries

Scientists John Connell and Yi Lin from NASA’s Solid-state Architecture Batteries for Enhanced Rechargeability and Safety (SABERS) project are working on experimental solid-state battery packs that could dramatically change the

Build a Website

How Much Does It Cost to Build a Website?

Are you wondering how much it costs to build a website? The approximated cost is based on several factors, including which add-ons and platforms you choose. For example, a self-hosted

Battery Investments

Battery Startups Attract Billion-Dollar Investments

In recent times, battery startups have experienced a significant boost in investments, with three businesses obtaining over $1 billion in funding within the last month. French company Verkor amassed $2.1

Copilot Revolution

Microsoft Copilot: A Suit of AI Features

Microsoft’s latest offering, Microsoft Copilot, aims to revolutionize the way we interact with technology. By integrating various AI capabilities, this all-in-one tool provides users with an improved experience that not

AI Girlfriend Craze

AI Girlfriend Craze Threatens Relationships

The surge in virtual AI girlfriends’ popularity is playing a role in the escalating issue of loneliness among young males, and this could have serious repercussions for America’s future. A

AIOps Innovations

Senser is Changing AIOps

Senser, an AIOps platform based in Tel Aviv, has introduced its groundbreaking AI-powered observability solution to support developers and operations teams in promptly pinpointing the root causes of service disruptions

Bebop Charging Stations

Check Out The New Bebob Battery Charging Stations

Bebob has introduced new 4- and 8-channel battery charging stations primarily aimed at rental companies, providing a convenient solution for clients with a large quantity of batteries. These wall-mountable and

Malyasian Networks

Malaysia’s Dual 5G Network Growth

On Wednesday, Malaysia’s Prime Minister Anwar Ibrahim announced the country’s plan to implement a dual 5G network strategy. This move is designed to achieve a more equitable incorporation of both

Advanced Drones Race

Pentagon’s Bold Race for Advanced Drones

The Pentagon has recently unveiled its ambitious strategy to acquire thousands of sophisticated drones within the next two years. This decision comes in response to Russia’s rapid utilization of airborne

Important Updates

You Need to See the New Microsoft Updates

Microsoft has recently announced a series of new features and updates across their applications, including Outlook, Microsoft Teams, and SharePoint. These new developments are centered around improving user experience, streamlining

Price Wars

Inside Hyundai and Kia’s Price Wars

South Korean automakers Hyundai and Kia are cutting the prices on a number of their electric vehicles (EVs) in response to growing price competition within the South Korean market. Many

Solar Frenzy Surprises

Solar Subsidy in Germany Causes Frenzy

In a shocking turn of events, the German national KfW bank was forced to discontinue its home solar power subsidy program for charging electric vehicles (EVs) after just one day,

Electric Spare

Electric Cars Ditch Spare Tires for Efficiency

Ira Newlander from West Los Angeles is thinking about trading in his old Ford Explorer for a contemporary hybrid or electric vehicle. However, he has observed that the majority of

Solar Geoengineering Impacts

Unraveling Solar Geoengineering’s Hidden Impacts

As we continue to face the repercussions of climate change, scientists and experts seek innovative ways to mitigate its impacts. Solar geoengineering (SG), a technique involving the distribution of aerosols

Razer Discount

Unbelievable Razer Blade 17 Discount

On September 24, 2023, it was reported that Razer, a popular brand in the premium gaming laptop industry, is offering an exceptional deal on their Razer Blade 17 model. Typically

Innovation Ignition

New Fintech Innovation Ignites Change

The fintech sector continues to attract substantial interest, as demonstrated by a dedicated fintech stage at a recent event featuring panel discussions and informal conversations with industry professionals. The gathering,