Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Adding Features to Applications

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.

As you design and develop your applications, you should consider how your decisions can affect your ability to deploy updates to your applications. This topic uses the Bank Branch Client reference implementation to describe the impact of two types of updates:

Creating a New Module

Modules are distinct deployment units of a Composite UI Application Block application. You can separate areas of your application into different modules to be able to deploy them to different users or applications. The Bank Branch Client reference implementation contains modules for the following application areas:

  • Credit Card Accounts. This module contains components related to the credit card back-end systems.
  • Basic Accounts. This module contains components that manage basic accounts, such as checking, savings, and certificates of deposit.
  • Branch Systems. This module contains components related to branch operations, such as services for managing the customer queue. The components are not specific to bank product offerings.
  • Infrastructure. This module contains the shell and components that are used by the other modules in the application.

After the initial application deployment, Global Bank purchases a financial lending institution and updates the Bank Branch Client application. The development team responsible for lending systems creates a new Lending Accounts module to expose the lending products to branch employees.

The new module must fulfill the following requirements:

  • It must add links to expose options for lending products to the Products panel (the right-side panel). (As an example, the Basic Accounts module adds the Purchase CD link.)
  • It must integrate account data into the customer summary view.
    The account summary view is deployed in the Branch Systems module. This means that changes to the view require updates to the Branch Systems module. The data for the Basic Accounts and Credit Card Accounts modules is returned from a single aggregation service. The service must be modified to support the new lending system. Alternatively, the team could use a separate service.

Additionally, a module can add links for queue management–related activities to the left-side panel. For example, the Branch Systems module adds the Service Customer link.

After the module is developed, the team must deploy it to each client. You can use ClickOnce to deploy the module assembly. The profile catalog returned by the Profile Catalog Web service must be updated to include the new module information.

Adding Links to Product Panel

The task pane, illustrated in Figure 1, in the Products panel is designed to be extended by modules. You do not have to deploy a new shell or Basic Accounts module. When the application executes the new module, the module adds tasks to the task pane. A module can add only the tasks that are relevant for the current customer. For example, the Basic Accounts module displays the option for purchasing a certificate of deposit for only existing branch customers; this option does not appear for walk-in customers.


Figure 1
Bank Branch Client task pane

Adding a task to this pane is accomplished using the following code (you can find code similar to this in the ModuleActions class in the BranchSystems.Module project of the Bank Branch Client reference implementation).

if (WorkItem.UIExtensionSites.Contains(UIExtensionSiteNames.ProductsPanel))
  UIExtensionSite site = WorkItem.UIExtensionSites[UIExtensionSiteNames.ProductsPanel];
  CreateAndRegisterLinkLabel(site, Resources.BuyStocks, CommandNames.BuyStocks);

This code adds the LinkLabel and registers a new command. To respond to the command for this link, you must create a new CommandHandler. The following code shows an example of this.

public void BuyStocks( object sender, EventArgs e ) {
  // Show the Buy Stocks view.

Displaying the Product Data in the Account Summary View

The account summary view, illustrated in Figure 2, displays the accounts for each product type in a separate DataGrid control. You must add a new DataGrid to the account summary view to support the display of lending accounts. Because this view resides in the Basic Accounts module, the deployment of the Lending Accounts module requires deployment of a new Basic Accounts module.


Figure 2
Account data displayed in DataGrid controls

When you design your user interface, consider choices that can affect deployment. In this example, an alternative implementation of the view would eliminate the requirement to update the view in the Basic Accounts module. For example, you can use a ListView control to display accounts grouped by product type, as illustrated in Figure 3.


Figure 3
Updated account summary view with a ListView for account data

Adding Links to the Customer Queue Panel

The Bank Branch Client reference implementation uses task panes to expose UI extension sites that modules can access. In this way, you can deploy new modules that display new options without having to update the implementation of the task pane. For example, a module can add tasks related to queue management to the left-side task pane (the "Customer Queue Panel"), as illustrated in Figure 4. Consider a new option, "Transfer Customer." An Officer can use this option to transfer the selected customer entry from his or her queue to the queue of a different officer.

This option is not specific to the Lending Accounts module. The appropriate module for this option is the Branch Systems module.


Figure 4
Task pane in the Customer Queue panel

To add a new option to the Customer Queue panel, perform the following activities:

  • Add tasks (as links) to the Customer Queue panel from the module. To do this, use the CustomerQueueLinks UI extension site of the CustomerQueueManagementView, as shown here.
    if (WorkItem.UIExtensionSites.Contains(UIExtensionSiteNames.CustomerQueueLinks))
        UIExtensionSite site = WorkItem.UIExtensionSites[UIExtensionSiteNames.CustomerQueueLinks];
        CreateAndRegisterLinkLabel(site, Resources.NewTask, CommandNames.NewTask);
  • Associate a command (WorkItem.Command) with the link, and create a CommandHandler handle for the click event, as shown here.
    public void NewTask( object sender, EventArgs e ) {
        // Show some new module view.

Aggregation Service

The account summary view displays data returned by an aggregation Web service. In the Bank Branch Client reference implementation, the service returns different data types for basic accounts and credit card accounts. This means that the account summary view contains code for each specific product type, and it must be updated to support new product types. To provide more flexibility, you can modify the aggregation service to return standardized data for all account types. The account summary view can use the standardized data and not require code specific to a product type. The introduction of a new product type in the back-end system does not require an update to the account summary view.

Adding a New Service to the Infrastructure Module

In the lifetime of the application, new services are introduced by the Infrastructure team and deployed in the Infrastructure module. Consider a new service that is used by both the Branch Systems module and the Basic Accounts module. To simplify application development and deployment, you can separate the module interface from the module implementation. For more information, see the Module Interface Separation pattern. With the interface and the implementation separated, perform the following steps to add a new service:

Change the Infrastructure module's interface class library and add the new service interface.

Add the new service implementation to the Infrastructure module.

With this partitioning, you can change the implementation of the service in the Infrastructure module without requiring a recompilation of the Branch Systems module or the Basic Accounts module. You must recompile those modules only when the Infrastructure interface assembly changes.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.