This section discusses the Catalog structure and
the names of the items in it, not the semantics of these items. Some
of these items have already been covered in the previous chapters,
and some are covered in subsequent chapters. The COM+ Catalog’s
actual structure, from the root down to the component level, is
mapped out in Figure 6-2. Each collection has a
predefined identifying name, whereas catalog objects’ names are
defined by the user. The root of the Catalog gives you access to
top-level collections such as the Applications
and
TransientSubscription
collections (see Chapter 9). You can also access less useful collections
such as the communication protocols used by DCOM or all of the
in-proc servers (COM objects in a DLL) installed on the machine.
Another top-level collection shown in Figure 6-2 is
the ComputerList
collection—a list of all
the computers that the Component Services Explorer is configured to
manage.
The Applications
collection, as the name implies,
contains all the COM+ applications installed on the machine. A
catalog object in the Applications
collection
allows you to set the properties of a particular COM+ application. It
also gives you access to two other collections: the
Roles
and the Components
collections. As mentioned previously, every folder in the Component
Services Explorer corresponds to a catalog collection. Just as every
application in the Component Services Explorer has a
Roles and Components
subfolder, a catalog object representing an application can give you
access to these two collections.
The Roles
collection contains a catalog object
for each role defined in the application. Chapter 7 discusses role-based security at length. Every
catalog object in the Roles
collection lets you
set its properties (such as the role name and description) and give
you access to a collection of users associated with that role, called
the UsersInRole
collection. Every catalog object
in the UsersInRole
collection represents a user
that was added to that role. As you can see in Figure 6-2, the objects in the
UsersInRole
collection do not have any collections
associated with them.
The Components
collection contains a catalog object
for each component in the application. You can programmatically
configure all the properties available on the properties page of a
component in the Component Services Explorer. Every component catalog
object can give you access to three collections: the
InterfacesForComponent
collection, the
SubscriptionForComponent
collection, and the
RolesForComponent
collection (see Figure 6-3).
The
InterfacesForComponent
collection contains a catalog object
for every interface the component supports. Every interface catalog
object gives you access to its properties and to two
collections—one is called the
RolesForInterface
collection, used to iterate over the
roles that were granted access for this interface, and the second
collection is the MethodsForInterface
collection.
The
MethodsForInterface
collection contains a catalog object
for each method on that interface. Each method catalog object can
give you access to its properties and to the roles associated with
that method, in a collection called
RolesForMethod
.
Going back to the collections accessible from every component catalog
object, the
RolesForComponent
collection lets you access the roles
associated with that component, and the
SubscriptionsForComponent
collection contains a catalog object
per a subscription to a COM+ Event (discussed in Chapter 9). Every subscription object is associated with
two collections—the
PublisherProperties
and the
SubscriberProperties
collection.
The only role objects that have collections of users associated with
them are in the Roles
collection accessible from
every application object (see Figure 6-2). The
component, interface, and method level role objects do not have user
collections associated with them (see Figure 6-3).
One more bit of COM+ Catalog trivia—every
catalog object always has at
least three collections associated with it: the
RelatedCollectionInfo
,
PropertyInfo
, and
ErrorInfo
collections. These collections were
omitted from Figure 6-2 and Figure 6-3 for the sake of clarity. The
RelatedCollectionInfo
collection is used for
advanced iterations over the Catalog, allowing you to write generic
recursive iteration code that discovers at runtime which collections
a particular catalog object is associated with. The
PropertyInfo
collection is used to retrieve
information about the properties that a specified collection
supports. The ErrorInfo
collection can provide
extensive error information for dealing with errors in methods that
update more than one catalog object at once, so you can find out
exactly which object caused the error. This chapter does not discuss
these three advanced collections.
When programming against the COM+ Catalog structure, you need not memorize the Catalog intricate structure. You can just follow the intuitive structure of the Component Services Explorer and simply provide the correct collection name, while using Figures 6-2 and 6-3 as reference navigation maps.