What the architecture provides
The ArcGIS architecture provides rich functionality to
the developer, but it is not a closed system. The ArcGIS
architecture is extendable by developers external to
ESRI.
The main focus of the ArcGIS architecture at version 9.x
revolves around four key concepts:
- Modularity —A modular system where the dependencies between components are well defined in a flexible system.
- Scalability —ArcObjects must perform well in all intended operating environments, from single-user Desktop applications to multiuser and multithreaded server applications.
- Multiple platform support —ArcObjects for the ArcGIS Engine and ArcGIS Server should be capable of running on multiple computing platforms.
-
Compatibility
—ArcObjects 9.x should remain equivalent, both
functionally and programmatically, to ArcObjects
8.3.
The following discusses each of these concepts:
The esriCore object library, shipped as part of ArcGIS
8.3, effectively packaged all of ArcObjects into one
large block of GIS functionality; there was no
distinction between components. The ArcObjects
components were divided into smaller groups of
components, these groups being packaged in dynamic link
libraries (DLLs). The one large library—while
simplifying the task of development for external
developers—prevented the software from being modular.
Adding the type information to all the DLLs, while
possible, would have greatly increased the burden on
external developers and, hence, was not an option. In
addition, the DLL structure did not always reflect the
best modular breakup of software components based on
functionality and dependency.
There is always a trade-off in performance and
manageability when considering architecture modularity.
For each criterion, thought is given to the end use and
the modularity required for support. For example, the
system could be divided into many small DLLs with only a
few objects in each. Although this provides a flexible
system for deployment options, at minimum memory
requirements, it would affect performance due to the
large number of DLLs being loaded and unloaded.
Conversely, one large DLL containing all objects is not
a suitable solution either. Knowing the requirements of
the components allows them to be effectively packaged
into DLLs.
ESRI has developed a modular architecture for ArcGIS 9.x by
a process of analyzing features and functions and matching
those with end user requirements and deployment options
based on the three ArcGIS product families. Developers who
have extended the ArcGIS 8 architecture with custom
components are encouraged to go through the same process to
restructure their source code into similar modular
structures.
The ArcGIS 9.x architecture is divided into a number of
libraries. It is possible for a library to have any
number of DLLs and executables (EXEs) within it. The
requirements that components must meet to be within a
library are well defined. For instance, a library, such
as esriGeometry (from the base services set of modules),
has the requirements of being thread-safe, scalable,
without user interface components, and deployable on a
number of computing platforms. These requirements are
different from libraries, such as esriArcMap (from the
applications category), which has user interface
components and is a Windows-only library.
An obvious functionality split to make is user interface
(UI) and nonuser interface code. User interface libraries
tend to be included only with the ArcGIS Desktop products.
All the components in the library will share the same
set of requirements placed on the library. It is not
possible to subdivide a library into smaller pieces for
distribution. The library defines the namespace for all
components within it and is seen in a form suitable for
your chosen application programming interface (API).
- Type Library—COM
- .NET Interop Assembly—.NET
- Java Package—Java
- Header File—C++
The ArcObjects components within ArcGIS Engine and
ArcGIS Server must be scalable. Engine objects are
scalable because they can be used in many different
types of applications; some require scalability, while
others do not. Server objects are required to be
scalable to ensure that the server can handle many users
connecting to it, and as the configuration of the server
grows, so does the performance of the ArcObjects
components running on the server.
The scalability of a system is achieved using a number
of variables involving the hardware and software of the
system. In this regard, ArcObjects supports scalability
with the effective use of memory within the objects and
the ability to execute the objects within multithreaded
processes.
There are two considerations when multithreaded
applications are discussed: thread safety and
scalability. It is important for all objects to be
thread-safe, but simply having thread safe objects does
not automatically mean that creating multithreaded
applications is straightforward or that the resulting
application will provide vastly improved performance.
The ArcObjects components contained in the base
services, data access, map analysis, and map
presentation categories are all thread safe. This means
that application developers can use them in
multithreaded applications; however, programmers must
still write multithreaded code in such a way as to avoid
application failures due to deadlock situations, and so
forth.
Thread safety refers to concurrent object access from
multiple threads.
In addition to the ArcObjects components being thread
safe for ArcGIS 9.x, the apartment threading model used
by ArcObjects was analyzed to ensure that ArcObjects
could be run efficiently in a multithreaded process. A
model referred to as threads in isolation was used to
ensure that the ArcObjects architecture is used
efficiently.
This model works by reducing cross-thread communication
to an absolute minimum or, better still, removing it
entirely. For this to work, the singleton objects at
ArcGIS 9.x were changed to be singletons per thread and
not singletons per process. The resource overhead of
hosting multiple singletons in a process was outweighed
by the performance gain of stopping cross-thread
communication where the singleton object is created in
one thread; normally, the main single-threaded apartment
(STA) and the accessing object are in another thread.
ArcGIS is an extensible system, and for the threads in
isolation model to work, all singleton objects must
adhere to this rule. If you are creating singleton
objects as part of your development, you must ensure
that these objects adhere to the rule.
The classic singleton per process model means that all
threads of an application will still access the main thread
hosting the singleton objects. This effectively reduces the
application to a single-threaded application.
As previously stated, ArcObjects components are C++
objects, meaning that any computing platform with a C++
compiler can potentially be a platform for ArcObjects.
In addition to the C++ compiler, the platform must also
support some basic services required by ArcObjects.
Although many of the platform differences do not affect
the way in which ArcObjects components are developed,
there are areas where differences do affect the way code
is developed. The byte order of different computing
architectures varies between little endian and big
endian. This is most readily seen when objects read and
write data to disk. Data written using one computing
platform will not be compatible if read using another
platform unless some decoding work is performed. All the
ArcGIS Engine and ArcGIS Server objects support this
multiple platform persistence model.
ArcObjects components always persist themselves using
the little endian model; when the objects read persisted
data, it is converted to the appropriate native byte
order. In addition to the byte order differences, there
are other areas of functionality that differ between
platforms; the directory structure, for example, uses
different separators for Windows and UNIX
®
—\ and /, respectively. Another example is the
platform-specific areas of functionality, such as object
linking and embedding database (OLE DB).
Microsoft Windows is a little endian platform, while Sun™
Solaris™ is a big endian platform.
Maintaining compatibility of the ArcGIS system between
releases is important to ensure that external developers
are not burdened with changing their code to work with
the latest release of the technology. Maintaining
compatibility at the object level was a primary goal of
the ArcGIS 9.x development effort. Although this
object-level compatibility has been maintained, there
are some changes between the ArcGIS 8 and ArcGIS 9.x
architectures that will affect developers, mainly
related to the compilation of the software.
Although the changes required for software created for
use with ArcGIS 8 to work with ArcGIS 9.x are minimal,
it is important to understand that to realize any
existing investment in the ArcObjects architecture at
ArcGIS 9.x, you must review your developments with
respect to ArcGIS Engine, ArcGIS Server, and ArcGIS
Desktop.
While the aim of ArcGIS releases is to limit the change
in the APIs, developers should still test their software
thoroughly with later releases.
ESRI understands the importance of a unified software
architecture and has made numerous changes for ArcGIS
9.x so the investment in ArcObjects can be realized on
multiple products. If you have been involved in creating
extensions to the ArcGIS architecture for ArcGIS 8, you
should think about how the new ArcGIS 9.x architecture
affects the way your components are implemented.