IIS and Component Services work together to form a basic architecture for building Web applications. IIS uses the functionality provided by Component Services to:
Note In IIS version 4.0, Microsoft Transaction Server (MTS) provided transaction support. In IIS 5.0, and Windows 2000, Component Services provides all the transaction support of MTS, in addition to a number of other component development and deployment features.
IIS defines Web applications as a collection of resource files that are grouped into a logical namespace. By grouping resources into applications you gain the ability to share data throughout the namespace and to run the application in an isolated process.
Internally, IIS coordinates isolated applications through an object known as the Web Application Manager. This object includes a public interface (IWAMAdmin) that you can use to create programs for administering Web applications. When you run a Web application in an isolated process, IIS uses Component Services to coordinate concurrent access to resources and pass context information between COM components.
IIS uses the Component Services ObjectContext object to give COM components that are called by ASP access to the ASP built-in objects. For example, if you were building a COM component in Visual Basic that needed to access a form submission from an HTML file, you could use the following code:
Dim objObjectContext As ObjectContext
Dim vntIn As Variant
Set objObjectContext = GetObjectContext ()
vntIn = objObjectContext.Item("Request").Form("Field1")
Component Services uses ObjectContext to maintain information about a particular instance of a COM component. When IIS compiles the ASP script, it calls Component Services to create an ObjectContext for tracking information about the ASP script. The ObjectContext includes an identity property that uniquely identifies instance of the ASP script. For example, if your ASP script creates instances of COM components that have been registered with Component Services, each of these objects will be associated with the ASP script's ObjectContext. Similarly, when you create a transactional ASP script with the @Transaction directive, Component Services is notified and a new transaction is started. From that point onwards, Component Services will coordinate the updating of any resources that are under its control. Component Services guarantees the transaction's integrity by tracking any changes made to persisted resources.
Note In IIS version 4.0, transaction support was provided by Microsoft Transaction Server (MTS). For IIS 5.0, and Windows 2000, Component Services provides all the transaction support of MTS, in addition to a number of other features.
For further information on isolating and managing applications, see Defining Application Boundaries.
For further information on transaction processing, see Processing Transactions, Understanding Transactions.