Library Reference  

System Library Overview


Supported with: ArcGIS Engine, ArcGIS Desktop, ArcGIS Server

Library dependencies: None


The System library is the lowest level library in the ArcGIS architecture. The library contains components that expose services used by the other libraries composing ArcGIS. There are a number of interfaces defined within System that can be implemented by the developer.

The System library contains the important AoInitialize object; all developers must use this object to initialize and un-initialize the ArcGIS Engine in applications that make use of Engine functionality.

The developer does not extend the System library but can extend the ArcGIS system by implementing interfaces contained within this library.

The System library contains many diverse objects with unrelated functionality, however there are some areas of functionality that can be grouped into subsystems. These library subsystems are:

 

Arrays and sets


The array and set objects act as containers for collections of other objects and values. They are used throughout ArcObjects.

The LongArray, DoubleArray, StrArray, and FileNames objects store collections of particular kinds of data; that is, they are homogenous collections.

The Array, Set, Property Set, and VarArray objects store heterogeneous data. Array and Set hold collections of objects, although for a Set an object can only be a member once. PropertySet is a keyed collection of objects or values. A VarArray is a collection of variants and thus can hold a variety of data.

 

Extensions


Extensions provide the developer with a powerful mechanism for extending the core functionality of the ArcGIS applications. An extension can provide a toolbar with new tools, listen for and respond to events, perform feature validation, and so on. Extensions act as a central point of reference for developers when they are creating commands and tools for use within the applications. Often these commands and tools must share data or access common UI components. An extension is the logical place to store this data and develop the UI components. The main reason for this is that there is only ever one instance of an extension per running application and, given an IApplication interface or with the ExtensionManager object, it is always possible to locate the extension and work with it.

See the document Names and IDs of ESRI extensions for details of how to programmatically find an ArcGIS extension.

Developing your own custom extension is covered in Extending ArcObjects: see Extending the user interface.

 

The ExtensionManager object is designed to allow you to enable licensed extensions, such as ArcGIS 3D Analyst, within your standalone application. Being a singleton object, ExtensionManager is the one and only instance of its class. An application can have only one ExtensionManager object. You could cocreate and use ExtensionManager from within ArcMap but there is no real need as the IExtensionManager interface is also available on the Application object.

 

Streams


When implementing your own objects, you will sometimes need to provide support for persistence. For example, with a custom feature renderer, persistence enables its settings to be written to an MXD file so that when ArcMap is restarted, the layer having custom rendering will be drawn in the same way as previously drawn. The COM concept of streams provides a way of reading and writing data to the persisted storage. The topic of persistence is covered in depth in Extending ArcObjects: see Implementing Persistence.

To provide persistence support for your custom object, you should implement one or both of IPersistStream and IPersistVariant. You may consume these interfaces on existing objects, particularly in your persistence implementation of your custom object. However, you should consider the use of an ObjectStream class in this situation.

ArcObjects defines some specific stream objects that you will find useful in persisting data. Each one implements the standard COM interfaces ISequentialStream and IStream. The MemoryBlobStream provides storage for binary data in memory. It is particularly useful for writing arbitrary data to databases. The ObjectStream is used is used in conjunction with another stream to persist ESRI objects. A FileStream is a specialized kind of stream for reading and writing files. An XMLStream supports reading and/or writing XML from files, strings, and binary buffers.

There are two stream helper objects: ByteSwapStreamIO helps convert the byte order of data, for example from big-endian to little-endian. This can be important for programs that need to work on both Windows and Unix systems. VariantStreamIO provides help for reading and writing variants to and from streams.

 

Component Categories

Component categories are used by client applications to efficiently find all components of a particular type that are installed on the system. For example, ArcMap only supports commands that implement the ICommand interface. A component category, ESRI Mx Commands, is used to find all the command components that can be used inside ArcMap. If component categories were not used, the application would have to instantiate each COM component and interrogate it to see if it supported the required functionality, which is not a practical approach. Component categories support the extensibility of COM by allowing the developer of the client application to create and work with classes that belong to a particular category. If, at a later date, a new class is added to the category, the client application need not be changed to take advantage of the new class; it will automatically pick up the new class the next time the category is read. Component categories and their relationship to ArcObjects are discussed extensively in Extending ArcObjects, see Component Categories

The ComponentCategoryManager object lets you add or remove components from categories and create new categories.

The CategoryFactory object is used to read the information in the registry to find out what classes are in a particular category. It can be used to instantiate an object from each class registered to a component category.

 

XML


The XML objects are used for reading and writing XML documents in a forward only manner.

Basic XML

The XMLStream object is an in-memory buffer that supports reading and/or writing XML from files, strings, and binary buffers. The stream is written to, or read from, by the XMLWriter and XMLReader objects. When reading or writing XML elements, you can represent the attributes and namespace declarations of an XML element with the XMLAttributes and XMLNamespaces classes.

The XMLTypeMapper class converts native types to XML Schema simple types.

XML Serialization

The XMLSerializer class serializes and deserializes ArcObjects that support IXMLSerialize. When using XMLSerializer, you can specify serialization flags with the XMLFlags class. The wrapper object XMLPersistedObject is used with XMLSerializer to serialize and deserialize ArcObjects that support IPersistStream.

 

Classify


This group of closely related objects can be used to group numeric values into classes. There are five types of classification objects: DefinedInterval, EqualInterval, NaturalBreaks, StandardDeviation, and Quantile coclasses. The job of all classification objects is to take histogram data (values and frequencies) and, given a desired number of classes, compute appropriate break values between the classes. The breaks are in increasing value and, except for the first break, represent the highest value in the class. The range of values that a class covers can vary; this range is the classs interval. If the values were from the attribute values of a feature layer, then, after determining the class breaks, you would typically set up a ClassBreaksRenderer. Also, the task of gathering the values and frequency counts from an attribute field can be made a lot easier by using the TableHistogram object to retrieve the histogram data. TableHistogram is defined in the CartoUI library. The histogram data is in the form of two arrays. The first of these is a sorted array of numeric values and the second is a corresponding array of frequency counts of the values.

The following example maps illustrate usage of the different classify objects:

 

NumberFormat


The number format objects convert numerical values into strings and strings into numerical values. How this conversion takes place is dependent on which coclass is used and the property settings of the interfaces on those classes.