Component Services





Component Services

OBJECTIVES

This chapter covers the following Microsoft-specified objective for the "Creating and Managing Microsoft Windows Services, Serviced Components, .NET Remoting Objects, and XML Web Services" section of the "Developing XML Web Services and Server Components with Microsoft Visual C# .NET and the Microsoft .NET Framework" exam:

Create and consume a serviced component.

  • Implement a serviced component.

  • Create interfaces that are visible to COM.

  • Create a strongly named assembly.

  • Register the component in the global assembly cache.

  • Manage the component by using the Component Services tool.

  • COM+ is a part of the Windows operating system that provides various infrastructure-level services to interested applications. These services include automatic transaction management, object pooling, just-in-time activation, queued components, and so on.

    .NET components that make use of COM+ component services are called serviced components. This exam objective tests your skills on creating and consuming serviced components. Although not explicitly mentioned in the objective list, you should be ready to answer questions on specific COM+ services because the reason for the existence of a serviced component is mainly to use these services.

    To use COM+ services, a serviced component must be registered with COM+. One of the requirements for the registration is that the assembly that contains the serviced component must be signed with a strong name. A strong name uniquely identifies the components in an assembly and avoids any identity clash with other components.

    One of the preferred places to deploy a component that uses COM+ services is the global assembly cache (GAC). The exam objective also requires you to know the process of deploying a component to the GAC.

    Windows provides a Component Services administrative tool. System administrators can use this tool to configure the serviced components at runtime. However, a serviced component's methods are not visible to this tool unless the component exposes the required interfaces. The exam objectives require you to know how to expose these interfaces and how to configure a component with the Component Services administrative tool.

OUTLINE

Introduction

Evolution of Component Services

Component Object Model (COM)

Microsoft Transaction Server (MTS)

COM+ 1.0 and COM+ 1.5

COM+ 2.0 (The .NET Framework)

Exposing .NET Components to COM/COM+

Calling a .NET Component from COM/COM+

Exporting .NET Components As COM Type Libraries

Architecture of Component Services

Serviced Components

Declarative Programming Model

COM+ Applications

COM+ Catalog

Serviced Component Activation

Context

Interception

Creating and Consuming a Serviced Component

Creating a Serviced Component

Creating a Strongly Named Assembly

Registering the Serviced Component into the COM+ Catalog

Using the Component Services Administrative Tool to Manage Components

Creating Interfaces That Are Visible to COM/COM+

The ClassInterface Attribute

Versioning Problems and the ClassInterface Attribute

The InterfaceType Attribute

Component Identification

Installing the Component in the Global Assembly Cache

Component Versioning

Consuming a Serviced Component

Understanding and Using Enterprise Services

Object Pooling

Configuring a Serviced Component to Use the Object Pooling Service

How Object Pooling Works

Creating an Object-Pooled Serviced Component

Using an Object-Pooled Serviced Component

Monitoring Statistics of a Serviced Component

Just-In-Time Activation

How Just-in-Time Activation Works

Using Just-in-Time Activation with Object Pooling—A Recipe for High Throughput

Design Considerations for Using Just-in-Time Activation and Object Pooling

Creating a JIT-Activated Object-Pooled Serviced Component

Using a JIT-Activated Object-Pooled Serviced Component

Object Construction

Automatic Transaction Processing

Using Automatic Transaction Service for Local Transactions

Elements of Transaction Processing

How Automatic Transaction Works

Using Automatic Transaction Service for Distributed Transactions

Queued Components

How Queued Components Work

Creating a Queued Component

Creating a Client for a Queued Component

Chapter Summary

Apply Your Knowledge

STUDY STRATEGIES

  • Understand the need for component services. Understand the reasons why you would implement some components as serviced components.

  • Know how to create a serviced component and then register the component in the COM+ Catalog.

  • Know how to use the Component Services administrative tool to configure the behavior of a serviced component.

  • Use various COM+ services such as automatic transactions, just-in-time activation, and object pooling in your programs.

  • Know how to create interfaces in a way that a serviced component's methods are visible to COM.


     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows