This document is archived and information here might be outdated.  Recommended version.


Inheritance of ArcGIS COM types in .NET (ArcObjects .NET 10.4 SDK)

Inheritance of ArcGIS COM types in .NET


About inheritance of ArcGIS COM types in .NET

Microsoft states that Component Object Model (COM) types can participate in inheritance as a base class in .NET. Managed types can derive directly or indirectly from a COM coclass. To qualify as a base class, the COM coclass must meet the following requirements:
  • Defined as metadata
  • Creatable
  • Aggregatable (in the COM sense)
Although managed types can extend the base class and override its methods, remember that all base methods of an interface must be overridden if you want to override any of the methods. For more information, see the Microsoft Developer Network (MSDN) Web site's topic, Inheritance, Aggregation, and Containment.
However, in ArcGIS, the inheritance of ArcGIS COM types in .NET is not supported. ArcGIS COM types are not for the usage of inheritance in .NET and as a result, you might encounter unexpected behavior when creating managed objects inherited from ArcGIS coclasses.
To ease your creation of ArcGIS custom components in .NET, a number of ArcGIS base classes are provided in the ESRI.ArcGIS.ADF.Local assembly. These base classes are managed types and can be inherited by other classes. If the ArcGIS base classes do not have the components you want, implement interfaces to customize your own classes.


See Also:

Inheritance, Aggregation, and Containment
Introduction to COM for ArcObjects developers
Introduction to .NET for ArcObjects developers
Working with ArcGIS base classes