Implementing enterprise services (COM+) in .NET
  1. Write a class. It must extend System.EnterpriseServices.ServicedComponent. Declaratively mark up the class and its members with any required attributes.
  2. Generate a strong name (key). All assemblies that run under Enterprise Services must be signed.
  3. Add Assembly information. At a minimum you need to set the ApplicationName and AssemblyKeyFile attributes. The latter is what links the assembly with the key generated in the previous step.
  4. Compile the assembly.
  5. Deploy the assembly:
    • Place the assembly in the Global Assembly Cache. This is not required, but is definitely recommended.
    • Register the assembly with COM+. Here you have three options: a) Manual registration using the regsvcs.exe command line utility; b) Programmatic registration using the RegistrationHelper class in the System.EnterpriseServices namespace; c) Lazy registration (recommended only for development purposes).
  6. Build and run the client.

The remainder of this article will walk you through each of these steps, explaining them in greater detail.

Building a transactional application
With the following steps you will build a serviced component an assembly that runs under Enterprise Services) that simulates a banking transaction. You will then build a small Windows Forms client application to consume the component.

To build and run this application you will need the final version of the Microsoft .NET Framework and administrative rights to the Northwind database included with the Microsoft Database Engine or Microsoft SQL Server. The steps assume you are using Visual Studio .NET. This IDE is not, however, required to build this application.

The server component simulates a balance of funds between two accounts. The transfer involves both a withdrawal and a deposit. To keep things simple, the transfer occurs within the same "bank," using the same database, and all of the business tier code is in a single class. As such, the transaction could have been handled entirely by SQL Server. In the real world, of course, this would normally not be the case.

Creating the database using Visual Studio .NET
You will need a new database for this example. Visual Studio .NET provides a convenient way to create databases using the new Server Explorer.

  1. Start Visual Studio .NET.

  2. Create a new Visual Basic .NET Windows Application project called "TransDemo".

  3. Select the View | Server Explorer menu command (or press CTRL+ALT+S) to open the Server Explorer.

  4. Expand Servers | SQL Servers | <Your computer name>.

  5. Right-click the server instance to which you will add a new database and select New Database.

  6. In the New Database Name field type BigBank.
  7. Select Use Windows NT Integrated Security, and then click OK.


    Figure 1: Creating the database

Subscribers who liked this article also read:
Handle and raise exceptions from Web services
by Thiru Thangarathinam, Intel Corp. An exception is any error cond...
Exploiting multithreading in .NET Apps
by John Sharp, Content Master Ltd. Intel Corp. With the introduct...
.NET application server fundamentals for the enterprise
by Matt Gillespie, technical author. Intel Corp. The Microsoft .N...

If you're interested in this topic, these articles may be helpful:

Handle and raise exceptions from Web services
by Thiru Thangarathinam, Intel Corp. An exception is any error cond...
Applying the Rational best practices to the .NET development lifecycle
by Alan Zeichick, principal analyst, Camden Associates The .N...
The challenge to integration: Java to .NET and beyond
by Jason Weisser, PhD, vice president, Enterprise Integration ...
The "Rich-Client" Advantage for .NET Web Services
by Dan Fineberg, enterprise/business marketing manager, and Gary Hayco...
Building Web services using Visual Studio .NET
by Soumya Guptha, technical marketing engineer Intel Corp. Softwa...

Related Jobs:

Software Developer 2 #IRC279006 - CA - Redwood City - Oracle
The SQL Metadata and Cursor Caching group is responsible for cach...
Software Developer #2405375 - NY - Buffalo - Ajilon
Description : With over 35 years of experience and 50 offices acro...
Software Development Engineer #148483 - WA - Redmond - Microsoft Corporation
Crazy about movies and TV? Ga-ga about your digital music? Love to ...
J2EE Architect #2481212 - OH - Columbus - Ajilon Consulting
Title : J2EE Architect Posted : 11-28-2005 Contact : Cha...
Technologist #139663 - WA - Redmond - Microsoft Corporation
The Application Consulting & Engineering (ACE) team is responsible for...
Sr C# .Net Developers #755 - FL - Tampa - RCG Information Technology
Description: All applicants must have a minimum of 3 years IT Industry...
Program Manager #150829 - WA - Redmond - Microsoft Corporation
Product: Windows Mobile Services Does the prospect of a market with 2...
Lead Software Development Engineer #147270 - WA - Redmond - Microsoft Corporation
Crazy about movies and TV? Ga-ga about your digital music? Love to...
Software Development Engineer #142066 - WA - Redmond - Microsoft Corporation
Are you passionate about your Recorded TV? Do you want to create the n...
Program Manager #145706 - WA - Redmond - Microsoft Corporation
Exchange Sustained Engineering Program Manager Come join the Exchange...