DEV 302 COM Services New Features Steve Swartz



![Scalability Enhancements l l Configurable Isolation Level Application Pooling scalable scal·a·ble [ skáyləb’l ] Scalability Enhancements l l Configurable Isolation Level Application Pooling scalable scal·a·ble [ skáyləb’l ]](https://slidetodoc.com/presentation_image_h2/1ea00dc11568e7626f317d7a58af21e5/image-4.jpg)

























- Slides: 29

DEV 302: COM+ Services: New Features Steve Swartz Program Manager COM+ Microsoft Corporation

Introduction Visual Studio. NET Framework IIS COM+ MSMQ Kernel Mode Services

Agenda l l Scalability Enhancements Availability Enhancements Manageability Enhancements Programming Model Enhancements
![Scalability Enhancements l l Configurable Isolation Level Application Pooling scalable scalable skáyləbl Scalability Enhancements l l Configurable Isolation Level Application Pooling scalable scal·a·ble [ skáyləb’l ]](https://slidetodoc.com/presentation_image_h2/1ea00dc11568e7626f317d7a58af21e5/image-4.jpg)
Scalability Enhancements l l Configurable Isolation Level Application Pooling scalable scal·a·ble [ skáyləb’l ] adjective • climbable : able to be climbed up or over • expandable : used to describe a computer, component, or network that can be expanded to meet future needs

Configurable Isolation Level l Problem: COM+ 1. 0 uses highest possible isolation level (SERIALIZABLE) to guarantee correct data Solution: Allow developers to declare minimum isolation level required Developer Benefit: Ø Ø Potential for increased concurrency, performance, and scalability Developer intent clearly communicated

Application Pooling l l l Problem: Single threaded or “fragile” processes don’ t scale Solution: Create a pool of processes to service one application Developer Benefit: Ø Ø Greater scalability Protects against process failures

Availability Enhancements l l Application Recycling Applications as NT Services Activation Gates COM+ Components as Web Services availability a·vail·a·bil·i·ty [ ə vàylə bíllətee ] noun • condition of being available : the condition of being available, especially of being easily accessible or obtainable

Application Recycling l Problem: The performance of most applications degrades over time Ø Ø l l Third-party code of uncertain quality Memory leaks Solution: Shut down and restart the application’s process Developer Benefit: A quick fix for known problems and a guard against unexpected ones

Application Recycling New process is started ID: 1 My App Process 1 is paused. New clients use process 2 Clients finish with process 1 Process 1 terminates Resource ID: 2 My App

Application Recycling

Applications As NT Services l l l Problem: COM+ 1. 0 Applications cannot run as NT services Solution: Allow COM+ 1. 5 applications to run as NT services Developer Benefit: Ø Ø Start at system boot or in order Run as Local. Service

Activation Gates l Problem: Creating components in low-memory situations Ø Ø l l Enough memory to create component but not enough to actually use it Low memory error handling code typically not well debugged Solution: Don’t allow activation in lowmemory situations Developer Benefit: Increased reliability

COM+ Web Services l l l Problem: DCOM (RPC) doesn’t cross firewalls or work with non-MS clients Solution: Use SOAP (HTTP/XML) to communicate with components Developer Benefit: Ø Ø Ø SOAP for VB 6 / VC++ 6 Services available to other platforms Works across firewalls

COM+ SOAP Requirements l l l Public components of Server applications Cannot return non S_OK positive HRESULTS such as S_FALSE No variable length arrays (no size_is, length_is) No user defined types (UDTs) No flowing of services across SOAP

Manageability Enhancements l l l Pause/Disable Applications Process Dump Application Partitions

Pause/Disable Applications l l Problem: No way to control component activations Solution: Allow administrative and programmatic control of component activation Ø Ø l Pause/Resume specific Dll. Hosts Disable/Enable COM+ Applications Developer Benefit: COM+ applications more manageable

Process Dump l l l Problem: Difficult to troubleshoot COM+ applications in production environment Solution: Allow administrator to dump the entire state of a process without terminating it Developer Benefit: COM+ applications much easier to troubleshoot

Application Partitions l l l Problem: Only a single application/component configuration is allowed on a single machine Solution: Allow multiple configurations of a single application/component on a single machine Developer Benefit: Easier to manage a few large serversus many small servers

Partitions Ford Chrysler GM App 1 App 2 Base Partition Server

Partitions l Users and Organizational Units are assigned to a partition in Active Directory or in the local server Henry Ford Sue Chrysler Mary GM Ford Chrysler Base Partition Server GM

Application Partitions l “Partition” is used to describe Ø Ø Ø l Hard drive partitions Partition of hardware in large systems Virtual machines COM+ Partitions represent a logical machine Ø Ø Ø COM+ applications only Registry not partitioned Not a virtual machine

Programming Model Enhancements l l Alias Components Public/Private Components Process Initialization Services without components

Alias Components l l l Problem: Only one configuration possible for a component Solution: Allow multiple configurations of a single component Developer Benefit: Ø Allow generic components to be shared by many different applications

Public/Private Components l l Problem: All COM+ components are public Solution: Allow both public and private components Ø Ø l Public components can be activated from other applications Private components can only be seen and activated from other components within the same application Developer Benefit: More control of functionality exposure

Process Initialization l l l Problem: No way to initialize a process or cleanup at process shutdown Solution: Allow components to support an interface that can be called at process startup and shutdown Developer Benefit: Ø Ø Applications can be warm started Initialization and Cleanup can be done

Services Without Components l l l Problem: You must package business logic in components to use COM+ services Solution: Allow developers to use services without packaging as a component (“SWC”) Developer Benefit: Ø Services can be applied where needed regardless of how packaged

SWC: Inline Services l l Select Services with CService. Config object Enter and Leave Service Domain via APIs Co. Enter. Service. Domain( IUnknown* p. Config. Object ); Co. Leave. Service. Domain ( void ); l l Code “within” APIs behaves as a configured component APIs can be nested, combined with other components

SWC: Batch Services l l Select Services with CService. Config object Create an “Activity” Co. Create. Activity ( IUnknown* p. Config. Object , REFIID riid, void** pp. Obj ); l Submit Batch work interface { HRESULT } l IService. Activity Synchronous. Call (IService. Call … ); Asynchronous. Call (IService. Call … ); Implement your work interface IService. Call { HRESULT On. Call ( void ); }
