Architecture of an Application Block

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

Figure 2 illustrates the run-time architecture of one sort of application block that you can produce with the Application Block Software Factory. This application block has a single typed provider.

Runtime architecture diagram

Figure 2
Run-time architecture of an application block.

The client code calls into the ProviderBaseFactory class with the CreateProviderBase method. The ProviderBaseFactory then calls the ProviderBaseInstanceFactory class. This class calls the Enterprise Library core, which examines the IProviderBase interface for the attribute that tells it what sort of custom factory to use. It creates an instance of that class and uses it to discover the appropriate configuration object. In this case, the correct object is the ProviderData class. The core then examines the ProviderData class for the Assembler attribute that tells it which assembler to build. It builds the assembler and passes it the ProviderData class. The assembler constructs an instance of the Provider class.

Application Block Software Factory Generated Files

Application Block Software Factory produces application blocks that have a run-time component and a design-time component. The run-time component implements the application block’s functionality. The application block also provides the configuration schema, which defines the application block’s behavior. The design-time component makes it possible to display this information in the configuration tools. Either of these tools allows you to read an application block’s current configuration, to change it and to store it. Most of an application block’s functionality and configuration information is contained in classes that implement the providers.

The Run-Time Component

Table 1 lists the most relevant run-time classes created by the Application Block Software Factory that implement a provider’s functionality.

Table 1: Run-time component classes for functionality

Class name

Description

Provider

This class is an implementation of the provider base class. The Create New Provider (Typed) or Create New Provider (Untyped) recipe creates this file.

ProviderBaseFactory

This is a static class that has a CreateProvider method. This method allows users to create instances of the provider. The New Provider Factory and Base recipe creates this file.

ProviderBaseCustomFactory

This class finds the correct configuration information for the provider that is being instantiated and returns it to the Enterprise Library core. The New Provider Factory and Base recipe creates this file.

ProviderBaseInstanceFactory

This is the entry point into the Enterprise Library core. The New Provider Factory and Base recipe creates this file.

ProviderBase

The provider base class that implements the IProviderBase interface. Provider implementations derive from this class

IProviderBase

The interface that the provider base class implements. The New Provider Factory and Base recipe creates this file.

Table 2 lists the run-time classes that contain an application block or a provider’s configuration information.

Table 2: Run-time component classes for configuration information

Class name

Description

ApplicationBlockSettings

This class defines the application block’s configuration information. The design-time counterpart of this file is ApplicationBlockSettingsNode class. The Create Application Block recipe creates this file.

ProviderBaseDataRetriever

This is a helper class that is responsible for retrieving the default instance name from the configuration.

ProviderBaseData

This class defines the base provider class’s configuration information. The design-time counterpart is the ProviderBaseNode class. The New Provider Factory and Base recipe creates this file.

ProviderData

This class defines the provider’s configuration information. The design-time counterpart is the ProviderNode class. The Create New Provider (Typed) or the Create New Provider (Untyped) recipe creates this file.

The Design-Time Component

The design-time component translates between the run-time configuration classes and the Configuration Console’s UI display. Table 3 lists the most relevant design-time files created by the Application Block Software Factory.

Table 3: Design-time component classes

Class name

Description

AddApplicationBlockSettingsNodeCommand

This class represents the menu command from the application that is used to add the configuration for the block (that is, “New, Data Access Application Block”)

ApplicationBlockSettingsNode

This class mirrors the properties in the ApplicationBlockSettingsNode. It represents the block’s top-level node in the configuration tool.

ApplicationBlockSettingsBuilder

This class translates the information in the UI configuration hierarchy nodes into run-time configuration classes. This is necessary in order to save the configuration information. The Create New Application Block recipe creates this file.

ApplicationBlockSettingsNodeBuilder

This class reads the configuration information by translating run-time configuration information into UI configuration hierarchy nodes. The Create New Application Block recipe creates this file.

CommandRegistrar

This class contains commands that place the nodes at the correct places in the configuration hierarchy. For example, the CreateSingleUICommand command ensures that a node only appears once. This class also associates the nodes with the correct UI commands such as Rename and Replace. The Create New Application Block recipe creates this file.

ConfigurationDesignManager

This class defines the UI commands, such as New, and the node maps for the configuration hierarchy. A node map defines the correspondence between the run-time configuration information and a UI node. It also contains the OpenCore method that reads the configuration information. The Create New Application Block recipe creates this file.

NodeMapRegistrar

This is a helper class that creates a mapping between nodes and configuration information. The Create New Application Block recipe creates this file.

ProviderBaseNode

This class mirrors the properties in the ProviderBaseData class. It also defines characteristics such as the Configuration Console category for the property and whether or not the property is required. The New Provider Factory and Base recipe creates this file.

ProviderNode

This class mirrors the properties in the ProviderData class. It also defines characteristics such as the Configuration Console category for the property and whether or not the property is required. The Create Design-Time Provider Node recipe creates this file.

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.
Show: