You are previewing COM & .NET Component Services.
O'Reilly logo
COM & .NET Component Services

Book Description

With COM and .NET Component Services, skilled COM developers can leverage their knowledge for the next generation of components to be built for Microsoft's new .NET framework. A primary goal of Microsoft's COM+ is to provide proven design solutions for scalable systems. Assuming experience with classic COM, COM and .NET Component Services focuses on the added services of COM+, including support for transactions, queued components, events, concurrency management, and security. Along the way, it ably demonstrates that COM+ is a masterpiece of design and usability from the ground up--truly a mature set of component services oriented for the middle tier. COM+ provides a foundation for robust, enterprise-wide, mission-critical distributed applications. And it's not limited to Internet applications. You can use COM+ services in the same places as classic COM components: in-house two-tier information systems, client-tier controls, desktop applications, machine control components, and every other conceivable application of COM. COM and .NET Component Services is the first book to stress the importance of learning to use COM+ services for both .NET and COM component-based applications. Since most companies have considerable investment in existing code base and development skills, COM+ can serve as a migration path for companies and developers. Companies can start (or continue) their projects in COM, using COM+ as a supporting platform for component services, and then when the time comes to move to .NET, they can start plugging .NET components seamlessly into the same architecture, reusing and interacting with their existing COM components.

Table of Contents

  1. COM and .NET Component Services
    1. Dedication
    2. Foreword
    3. Preface
      1. Scope of This Book
      2. Some Assumptions About the Reader
      3. Definitions and Text Conventions
      4. Other COM+ Books and References
      5. How to Contact Us
      6. Acknowledgments
    4. 1. COM+ Component Services
      1. COM+ Component Services
      2. The Component Services Explorer
      3. Hello COM+
        1. Building a COM Component
        2. Creating a COM+ Application
        3. Adding a Component to a COM+ Application
        4. Writing a Test Client
      4. COM+ Configured Components
      5. Applications, DLLs, and Components
      6. Configuring COM+ Applications
        1. COM+ Application Types
        2. COM+ Surrogate Processes
        3. Idle Time Management
      7. Debugging COM+ Applications
      8. Deploying COM+ Applications
        1. Proxy COM+ Applications
        2. Installing and Uninstalling an Exported Application
      9. Summary
    5. 2. COM+ Context
      1. Encapsulation via Marshaling in COM
      2. Encapsulation via Interception in COM+
        1. Lightweight Proxies
        2. Assigning Objects to Contexts
      3. The Context Object
      4. The Call Object
      5. Cross-Context Manual Marshaling
        1. The Global Interface Table
        2. The GIT Wrapper Class
      6. Summary
    6. 3. COM+ Instance Management
      1. Client Types
        1. Scaling Up with Rich Clients
        2. Scaling Up with Internet Clients
      2. Instance Management and Scaling
      3. Object Pooling
        1. Pooled Object Life Cycle
        2. Configuring Pool Parameters
        3. Pooled Object Design Requirements
        4. Object Pooling and Context
      4. Just-in-Time Activation
        1. How JITA Works
        2. Benefits of Using JITA
        3. Using JITA
        4. JITA and IObjectControl
      5. Combining JITA with Object Pooling
      6. Object Constructor String
      7. COM+ Instance Management Pitfalls
        1. Idle Time Management
        2. Too Large a Minimum Pool Size
        3. Requesting a JITA Object in the Caller’s Context
        4. Failing to Release Pooled Object Data Members
        5. Pooled Objects and Aggregation
        6. Tracking Instance Activity
    7. 4. COM+ Transactions
      1. Transaction Basics
      2. Transaction Properties
        1. The Atomic Property
        2. The Consistent Property
        3. The Isolated Property
        4. The Durable Property
      3. Transaction Scenarios
        1. Single Object/Single Resource Transaction
        2. Multiple Objects/Single Resource Transaction
        3. Multiple Objects/Multiple Resources Transaction
      4. COM+ Transactions Architecture
        1. Resource Managers
        2. Transaction Root
        3. The Two-Phase Commit Protocol
        4. The Distributed Transaction Coordinator
        5. Transactions and Context
        6. COM+ Transactions Architecture Benefits
      5. Configuring Transactions
        1. Transaction Disabled
        2. Transaction Not Supported
        3. Transaction Supported
        4. Transaction Required
        5. Transaction Requires New
        6. Transaction Support IDL Extension
      6. Voting on a Transaction
      7. Transactional Object Life Cycle
        1. State-Aware Objects
        2. Transactions and JITA
        3. Collecting Objects’ Votes
        4. The IObjectContext Interface
        5. Method Auto-Deactivation
        6. Object Life Cycle Example
      8. Designing Transactional Components
        1. Designing Transactional Interfaces
        2. Acquiring Resources
      9. Nontransactional Clients
      10. Transactions and Object Pooling
      11. Compensating Transactions
      12. Transaction Execution Time
      13. Tracing Transactions
      14. In-Doubt Transactions
      15. Transaction Statistics
      16. COM+ Transactions Pitfalls
        1. Accessing Nontransactional Resources
        2. Passing Subroot Objects to Clients
        3. Accessing Objects Outside the Transaction
    8. 5. COM+ Concurrency Model
      1. Object-Oriented Programming and Multiple Threads
      2. Apartments: The Classic COM Solution
      3. Activities: The COM+ Innovation
        1. Causality-Based Lock
        2. Activities and Contexts
      4. COM+ Configuration Settings
        1. Synchronization Disabled
        2. Synchronization Not Supported
        3. Synchronization Supported
        4. Synchronization Required
        5. Synchronization Requires New
        6. Required Versus Requires New
      5. Activities and JITA
      6. Activities and Transactions
      7. Tracing Activities
      8. The Neutral Threaded Apartment
        1. The NTA and Other COM Threading Models
        2. COM+ and Threading Model
      9. Summary
    9. 6. Programming the COM+ Catalog
      1. Why Program the Catalog?
      2. The Catalog Programming Model
      3. Catalog Structure
      4. Interacting with the Catalog
        1. The Catalog Root Object
        2. The ICatalogCollection Interface
        3. The ICatalogObject Interface
        4. Using the Catalog Interfaces
        5. Saving Changes
        6. Object Properties Interdependencies
      5. Features of COMAdminCatalog
      6. The COM+ Catalog and Transactions
      7. Summary
    10. 7. COM+ Security
      1. The Need for Security
      2. Basic Security Terms
        1. Security Identity
        2. Authentication
        3. Authorization
        4. Launch Security
        5. Impersonation
      3. Role-Based Security
        1. Configuring Role-Based Security
        2. Role-Based Security Benefits
        3. Designing Role-Based Security
        4. Deploying and Administering Role-Based Security
      4. Securing a Server Application
        1. Configuring the Server Application Identity
        2. Enabling Authorization
        3. Setting the Security Level
        4. Setting the Authentication Level
          1. Authentication = None
          2. Authentication = Connect
          3. Authentication = Call
          4. Authentication = Packet
          5. Authentication = Packet Integrity
          6. Authentication = Packet Privacy
          7. Deciding on the authentication level
          8. Client authentication level compatibility
        5. Setting the Impersonation Level
          1. Impersonation = Anonymous
          2. Impersonation = Identify
          3. Impersonation = Impersonate
          4. Impersonation = Delegate
      5. Securing a Library Application
        1. Both Role-Based Security and Global Authentication
        2. Global Authentication Without Role-Based Security
        3. Role-Based Security Without Global Authentication
        4. Neither Role-Based Security nor Authentication
      6. Programmatic Role-Based Security
      7. Security Boundaries
      8. Advanced COM+ Security
        1. Server-Side Impersonation
        2. Programmatic Client-Side Security
      9. COM+ Security Pitfalls
        1. Machine-Wide Security Settings
        2. Calling CoInitializeSecurity( )
        3. Disabling Changes to the Application Configuration
        4. Avoid Sensitive Work at the Object Constructor
        5. Changing Application Activation Mode
        6. IsCallerInRole( ) Returns TRUE When Security Is Not Enabled
        7. Disabling Application-Level Authorization
        8. Enabling Application-Level Authorization
      10. Summary
    11. 8. COM+ Queued Components
      1. Major Benefits of Queued Components
        1. Disconnected Work
        2. Real Life Business Model
        3. Component Availability
        4. MSMQ Participates in Transactions
        5. Auto-Retry Mechanism
        6. Scalability
        7. Workload Buffering
        8. When Should You Use Queued Components?
      2. Queued Components Architecture
        1. The Recorder
        2. The Player
        3. The Listener
      3. Component Services Explorer Configuration
        1. Application Configuration
        2. Queued Component Interface Configuration
      4. Invoking Queued Components on the Client Side
      5. Designing Queued Component Interfaces
      6. Receiving Output from a Queued Component
      7. Queued Component Error Handling
        1. Handling Poison Calls
        2. Queued Component Exception Classes
          1. Client-side exception handling
          2. Server-side exception handling
          3. The MessageMover class
      8. Queued Components and Transactions
      9. Synchronous Versus Asynchronous Components
        1. Changes in Transaction Semantics
        2. Changes in Workflow
      10. Queued Components Security
        1. Queued Calls Authentication
        2. Queued Components and Role-Based Security
        3. Queued Components Security Limitations
      11. Queued Components Pitfalls
        1. MSMQ Setup
        2. Queued Component Client
        3. Visual Basic Persistable Objects
        4. IDispatch Considerations
        5. Queued Component Application Startup
      12. Summary
    12. 9. COM+ Event Service
      1. Classic COM Events
      2. COM+ Event Model
      3. The Event Class
        1. Adding an Event Class
        2. Supplying the Event Class Definition
        3. Event Class Interface Design Guidelines
      4. Subscription Types
        1. Adding a Persistent Subscription
        2. Adding a Transient Subscription
      5. Delivering Events
        1. Serial Versus Parallel Publishing
        2. Error Handling
        3. Publishing Order
      6. Event Filtering
        1. Publisher Filtering
          1. Implementing a publisher filter
          2. The CGenericFilter helper class
          3. Parameters-based publisher filtering
          4. Custom subscription properties
          5. Installing a publisher filter
          6. Static association of a publisher filter with an event class
          7. Dynamic association of a publisher filter with an event class
        2. Subscriber-Side Filtering
          1. Persistent subscriber-side filtering
          2. Transient subscriber-side filtering
      7. Distributed COM+ Events
        1. Solution 1: One Machine for All the Subscribers and Event Classes
        2. Solution 2: Machine-Specific Event Classes
        3. Solution 3: COM+ Routing
      8. Asynchronous Events
        1. Asynchronous Publishing
        2. Asynchronous Subscribers
      9. COM+ Events and Transactions
        1. Persistent Subscribers and Transactions
        2. Transient Subscribers and Transactions
      10. COM+ Events and Security
        1. The Event Class and Role-Based Security
        2. Subscribers and Role-Based Security
        3. In-Process Subscribers
        4. Per-User Subscriptions
      11. COM+ Events Limitation
      12. Summary
    13. 10. .NET Serviced Components
      1. Developing Serviced Components
      2. .NET Assemblies and COM+ Applications
      3. Registering Assemblies
        1. Specifying Application Name
        2. Understanding Serviced Component Versions
        3. Manual Registration
        4. Dynamic Registration
        5. Programmatic Registration
        6. The ApplicationID Attribute
        7. The Guid Attribute
        8. The ProgId Attribute
      4. Configuring Serviced Components
      5. Application Activation Type
      6. The Description Attribute
      7. Accessing the COM+ Context
      8. COM+ Context Attributes
      9. COM+ Object Pooling
      10. COM+ Just-in-Time Activation
        1. Using IObjectControl
        2. IObjectControl, JITA, and Deterministic Finalization
      11. COM+ Constructor String
      12. COM+ Transactions
        1. Voting on the Transaction
        2. The AutoComplete Attribute
        3. The TransactionContext Object
        4. COM+ Transactions and Nonserviced Components
          1. Web services and transactions
          2. ASP.NET and transactions
      13. COM+ Synchronization
      14. Programming the COM+ Catalog
      15. COM+ Security
        1. Configuring Application-Level Security Settings
        2. Component-Level Access Checks
        3. Adding Roles to an Application
        4. Assigning Roles to Component, Interface, and Method
        5. Verifying Caller’s Role Membership
      16. COM+ Queued Components
        1. Configuring Queued Interfaces
        2. A Queued Component’s Managed Client
        3. Queued Component Error Handling
          1. Queued component exception class
          2. The MessageMover class
      17. COM+ Loosely Coupled Events
      18. Summary
    14. A. The COM+ Logbook
      1. Logbook Requirements
      2. Log File Example
      3. Using the Logbook
      4. Configuring the Logbook
      5. How Does the Logbook Work?
      6. Summary
    15. B. COM+ 1.5
      1. Improved User Interface Usability
      2. Legacy Applications and Components
        1. Legacy Applications
        2. Legacy Components
      3. Disabling Applications and Components
      4. Pausing Applications
      5. Service Activation Type
      6. Improved Queuing Support
      7. Application Pooling and Recycling
        1. Application pooling
        2. Application Recycling
        3. Programmatic Recycling
      8. Application Dump
      9. Application Partitioning
      10. Aliasing Components
      11. Configurable Transaction Isolation Level
      12. Improved Context Activation Setting
      13. Private Components
      14. Web Services in COM+ 1.5
      15. Summary
    16. C. Introduction to .NET
      1. .NET Programming Languages
      2. Packaging .NET Components: Assemblies
      3. Developing .NET Components
        1. Using Namespaces
        2. Using Interfaces
      4. Writing .NET Client-Side Code
      5. .NET as a Component Technology
        1. Simplified Component Development
          1. The .NET base classes
          2. Component inheritance
          3. Component visibility
          4. Attribute-based programming
          5. Component-oriented security
        2. Simplified Component Deployment
        3. Simplified Object Life Cycle Management
        4. Nondeterministic Finalization
        5. COM and Windows Interoperability
      6. Composing Assemblies
        1. Sharing Assemblies
        2. Assembly Metadata
        3. Assembly Manifest
        4. Assembly Files
    17. Index
    18. Colophon