As previously mentioned, in the .NET-based PAPI, Microsoft has exposed the underlying base classes from which the CMS classes are derived. These classes are typically not intended to be instantiated. They are exposed for the purpose of highlighting class inheritance as an important aspect of the .NET programming paradigm.
Let's put the CMS Context classes into context (Figure 23-9). The items with dotted lines are discussed in other chapters in this book.
Figure 23-9. CMS Context context
The System.Object class is the ultimate superclass of all classes in the .NET Framework. As such it supports all classes in the .NET Framework class hierarchy and provides low-level services to classes derived from it. System.Object is the root of the .NET type hierarchy.
CMS derives CmsContext, the base class for all classes that allow you to access PAPI, from System.Object. The CmsContext class provides the base properties and methods common to CmsHttpContext (the context of a CMS Web page), CmsApplicationContext (the context when there is no posting URL involved, as is the case in Web Services, stand-alone applications, and Web pages that need a context other than the one handed them by CMS), and Autosession (the context used in older versions of CMS and in ASP pages for the current release of CMS). We discuss the first two of these contexts separately in Chapter 24.
Interestingly, Microsoft has included one additional level of abstraction called CmsAspContext. This intermediate class inherits a lot of its functionality from CmsContext but adds critical functionality for accessing channel- and posting-specific content common to both CmsHttpContext and Autosession (this COM-based component is included for backward compatibility with previous versions and for ASP-based CMS development). So, CmsAspContext and CmsApplicationContext are on the same level in the class hierarchy, but we will never interact directly with CmsAspContext.
The HierarchyItem class provides the base functionality for dealing with all three CMS hierarchies. ChannelItem, ResourceGalleryItem, and TemplateGalleryItem all provide the unique functionality common for their respective hierarchy.
Similarly, the CmsCollection class provides the base functionality for dealing with CMS collections. CmsManagedCollection, HierachyItemCollection, and ChannelItemCollection then provide the various specific collections with the unique functionality common for their respective collections.
Placeholder and PlaceholderDefinition provide the base functionality for dealing with CMS Placeholders, while LegacyPlaceholder provides functionality for placeholder types used in previous versions of CMS.
CMS has nine types of exceptions that all inherit their base functionality from the CmsException and CmsPublishingException base classes.