What's new for developers at 10?


Summary
This topic provides an overview of the new features and enhancements at ArcGIS 10 for developers working with Java application programming interfaces (APIs) for ArcObjects.

In this topic


Integrated ArcObjects SDK

At ArcGIS 10, there is a single software development kit (SDK) for ArcObjects. It combines the content previously contained in the ArcGIS Engine Java SDK along with ArcObjects development specific to ArcGIS Server. The ArcObjects SDK for Java includes documentation, samples, developer  tools, and Eclipse plug-ins for ArcObjects development. It focuses on the following major categories of ArcObjects applications:
The included documentation has been enhanced with a reorganized table of contents (TOC) that focuses on the tasks developers want to accomplish.

Architectural modifications

ArcGIS 10 includes several significant product architecture modifications. One of the major advantages of the new architecture is autonomous ArcGIS Desktop and Engine runtimes. You can now install ArcGIS Desktop and ArcGIS Engine products in independent locations on your machine. You can also install service packs for Engine and Desktop products independently. However, these architectural changes require you to explicitly bind your stand-alone (Engine) applications and custom components to a specific ArcGIS product on your machine.
A stand-alone application can be bound to a Desktop or Engine runtime. In Eclipse, when you create a project and add the arcobjects.jar library to your classpath, Eclipse asks you which runtime to bind to, if both products are installed. Outside of Eclipse, the binding is achieved by including the following code example before using any ArcObjects.
For ArcGIS Engine, the following code example can be used to bootstrap the arcobjects.jar library:
[Java]
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;

public class Main{

    public static void main(String[] args)throws Exception{
        bootstrapArcobjectsJar();
        ApplicationName.main(args); 
            //Replace ApplicationName with your application's main class.
    }

    public static void bootstrapArcobjectsJar(){

        //Get the ArcGIS Engine runtime, if it is available.
        String arcObjectsHome = System.getenv("AGSENGINEJAVA");

        //If no runtime is available, exit application gracefully.
        if (arcObjectsHome == null){
            System.err.println(
                "You must have the ArcGIS Engine Runtime installed in order to execute this application.");
            System.err.println(
                "Install the product above, then re-run this application.");
            System.err.println("Exiting execution of this application...");
            System.exit( - 1);
        }

        //Obtain the relative path to the arcobjects.jar file.
        String jarPath = arcObjectsHome + "java" + File.separator + "lib" +
            File.separator + "arcobjects.jar";

        //Create a file.
        File jarFile = new File(jarPath);

        //Test for file existence.
        if (!jarFile.exists()){
            System.err.println(
                "The arcobjects.jar was not found in the following location: " +
                jarFile.getParent());
            System.err.println(
                "Verify that arcobjects.jar can be located in the specified folder.")
                ;
            System.err.println(
                "If not present, try uninstalling your ArcGIS software and reinstalling it.");
            System.err.println("Exiting execution of this application...");
            System.exit( - 1);
        }

        //Helps load classes and resources from a search path of URLs.
        URLClassLoader sysloader = (URLClassLoader)ClassLoader.getSystemClassLoader()
            ;
        Class < URLClassLoader > sysclass = URLClassLoader.class;

        try{
            Method method = sysclass.getDeclaredMethod("addURL", new Class[]{
                URL.class
            }
            );
            method.setAccessible(true);
            method.invoke(sysloader, new Object[]{
                jarFile.toURI().toURL()
            }
            );
        }
        catch (Throwable throwable){
            throwable.printStackTrace();
            System.err.println("Could not add arcobjects.jar to system classloader");
            System.err.println("Exiting execution of this application...");
            System.exit( - 1);
        }
    }
}
For ArcGIS Desktop (Windows machines only), use the following code example:
[Java]
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;

public class Main{

    public static void main(String[] args)throws Exception{
        bootstrapArcobjectsJar();
        ApplicationName.main(args); 
            //Replace ApplicationName with your application's main class.
    }

    public static void bootstrapArcobjectsJar(){

        //Get the ArcGIS Desktop runtime, if it is available.
        String arcObjectsHome = System.getenv("AGSDESKTOPJAVA");

        //If no runtime is available, exit application gracefully.
        if (arcObjectsHome == null){
            System.err.println(
                "You must have ArcGIS Desktop installed in order to execute this application.");
            System.err.println(
                "Install the product above, then re-run this application.");
            System.err.println("Exiting execution of this application...");
            System.exit( - 1);
        }

        //Obtain the relative path to the arcobjects.jar file.
        String jarPath = arcObjectsHome + "java" + File.separator + "lib" +
            File.separator + "arcobjects.jar";

        //Create a file.
        File jarFile = new File(jarPath);

        //Test for file existence.
        if (!jarFile.exists()){
            System.err.println(
                "The arcobjects.jar was not found in the following location: " +
                jarFile.getParent());
            System.err.println(
                "Verify that arcobjects.jar can be located in the specified folder.")
                ;
            System.err.println(
                "If not present, try uninstalling your ArcGIS software and reinstalling it.");
            System.err.println("Exiting execution of this application...");
            System.exit( - 1);
        }

        //Helps load classes and resources from a search path of URLs.
        URLClassLoader sysloader = (URLClassLoader)ClassLoader.getSystemClassLoader()
            ;
        Class < URLClassLoader > sysclass = URLClassLoader.class;

        try{
            Method method = sysclass.getDeclaredMethod("addURL", new Class[]{
                URL.class
            }
            );
            method.setAccessible(true);
            method.invoke(sysloader, new Object[]{
                jarFile.toURI().toURL()
            }
            );
        }
        catch (Throwable throwable){
            throwable.printStackTrace();
            System.err.println("Could not add arcobjects.jar to system classloader");
            System.err.println("Exiting execution of this application...");
            System.exit( - 1);
        }
    }
}

Supported platforms

For information on all Java supported platforms, and hardware and software requirements for the current release, see ArcObjects SDK System Requirements.

New features

The following subsections provide an overview of new features in ArcGIS 10.

ArcGIS Engine concurrent licensing

You can now obtain concurrent Engine licenses via a license server. Previous releases of ArcGIS Engine supported only a single-user, per machine license. The concurrent licensing model allows Engine applications to withdraw licenses from a server that can host a fixed number of licenses.

Customizing ArcGIS Desktop using add-ins

An add-in is a supplemental program that is simple to build, share, and deploy within ArcGIS Desktop applications (that is, ArcMap, ArcCatalog, ArcScene, and ArcGlobe). In addition, you can also develop add-ins to add custom functionality and special features to ArcGIS Desktop applications by accessing the underlying ArcObjects programmatically. After building an add-in, deploy them to a well-known folder location and the ArcGIS Desktop applications will recognize and consume them at runtime.
At ArcGIS Desktop 10, you can create the following types of add-ins using Java:

New Eclipse plug-ins

To help expedite the development of ArcGIS Desktop add-ins, several new Eclipse plug-in wizards have been created at ArcGIS 10. For the add-in work previously described, this includes the follow new project wizards:
Each wizard guides you through all the required and optional components for extending any ArcGIS Desktop application.

ArcObjects code validator

Developers programming with ArcObjects need to be aware of a small number of classes and interfaces that are not amenable to Java style casting. In order to avoid ClassCastExceptions and subtle logical errors in your programs up until the release of ArcGIS 10, ESRI has published a list of such classes and interfaces. This list is tedious to consult for every ArcObjects used in an application to remove such potential errors. To address this problem and simplify a developer's experience, a plug-in for Eclipse can be used to detect statements using unsafe casting and runtime type checks, and provide suggestions to rectify such potential problems. The ArcObjects code validator can be used with existing or new projects at 10.

Server object extensions

SOEs are a custom components that can be developed in Java, .NET, and C++ to extend the ArcGIS Map Server Object.  An SOE is created and initialized at the time the Server Object instance is created and is re-used at the request level, like the Server Object itself.  If the SOE is costly to initialize, that cost is paid only once when the Server Object instance is created. Also, since an instance of an SOE remains alive as long as the Server Object's instance, it is able to cache information that can be re-used from request to request. 
SOEs are best suited for applications that make several fine-grained ArcObjects calls between client and server processes. Developers can move the most expensive code to the SOE, thus reducing the number of fine grained calls between the client and  server, and thereby increasing efficiency and responsiveness of client applications.
The following applies at ArcGIS 10:

New environment variables

With the release of previous versions of ArcGIS, the ARCGISHOME environment variable was used to determine the location of ArcGIS Engine runtime and SDKs. This environment variable operated under the assumption that all ArcGIS software was installed on one location on a given machine. At the release of ArcGIS 10, the Java ArcObjects SDK will not be required to be installed in the same location as ArcGIS Desktop or ArcGIS Engine runtimes. Thus, the ARCGISHOME environment variable has been updated and changed into the following new environment variables:

Map automation using Python

A new Python mapping module provides commands to interact with map (.mxd) documents  and layer (.lyr) files. You can create Python scripts using these commands to open map documents and layers, query and alter contents, then print, export, or save the modified document. These commands are also useful for implementing multiple document workflows, such as updating and fixing data source locations, and for creating reports based on layers, data sources, or symbology. You can also combine several map documents to output a map book (similar to the functionality previously provided in the DS Map Book sample) or atlas to the printer or a .pdf file.

Background execution of geoprocessing tools

Since ArcGIS 9.2, developers have been able to run geoprocessing jobs (tools or models) using the IGeoprocessor2s execute() method, but the progress of the application was stalled during execution. At ArcGIS 10, the new IGeoprocessor2s executeASync() method can be used to execute geoprocessing jobs in the background of an application—which means the application can progress and respond to user interaction—while a geoprocessing job is being executed. You can also run more than one background geoprocessing job in an application. For more information, see How to run a geoprocessing tool in the background.

GraphicTracker for moving objects

The new GraphicTracker APIs allow you to visualize dynamic tracking of 100 moving objects on a two-dimensional (2D) map (.mxd) or three-dimensional (3D) globe (.3dd) without flickering. Each moving object can also be assigned a text label and optional text symbol. The GraphicTracker implementation minimizes refresh of display and provides smooth transition when a moving object is added to or removed from the display. Additionally, the moving object symbols can be made transparent, highlighted, oriented to x-, y-, and z-axes, or floated above the display according to the z-value. The object symbols can also be scaled based on the symbol's size or automatically shrunk when the display becomes large scale (bill-boarded).

Basemap layers for improved map navigation and display

A basemap layer is a special type of group layer for storing reference layers used for visualization or navigation purposes (for example, aerial imagery, streets, and land parcels). The basemap layer is drawn using optimized display logic and provides a continuous display that makes it easy to navigate around a map. You can create a basemap layer programmatically using the BasemapLayer class. A basemap layer can be added to or removed from a map document (.mxd file) the same way as any other layer.

Visualizing spatial datasets in ArcGIS

Temporal visualization is now supported in ArcGIS. Features layers, graphic layers, and other layers can be configured to render based on time attributes. Many of the layers can use existing time-related data that is properly formatted. Multiple layers can participate in time view at once. ArcGIS provides a time control user interface (UI) element, but the map can also be controlled programmatically.

ArcMap editing enhancements

The following editing enhancements are available:

Display expressions for advanced MapTips

A Display field is used to identify a feature when using the Identify window or to provide text for MapTips. You can now customize the text string of MapTips by creating a display expression using the IDisplayExpressionProperties interface. Using display expressions, you can concatenate or modify the attribute values of one or more fields, or include additional text strings to create more advanced MapTips. A display expression can also contain Visual Basic script or JavaScript to add logic and text processing for advanced MapTips.

Attribute-driven symbology

You can define the symbols for a feature layer based on its attribute value. See the following:

PNG and alpha-blending bitmap support for icons

Higher quality icons are supported that uses alpha-blending bitmaps and Portable Network Graphics (PNG) image formats. These icons are available when you install the ArcObjects SDK and can be used for developing commands and tools in both ArcGIS Engine and ArcGIS Desktop applications.

Enhancements to the Java-COM interop

The following is an enhancement made to the VisualBean mode of stand-alone applications:

New VisualBean mode architecture

In prior releases, the ArcGIS Java-COM interop relied upon Component Object Model (COM) marshalling to synchronize access to ArcObjects hosted in the ArcGIS single threaded apartment (STA) for Visual Beans applications. For an explanation of the old architecture, see  Understanding Java-COM interop. In particular, refer to the section, Java interop and VisualBeans application.

At the release of ArcGIS 10, the internal architecture has been revamped to ensure thread affinity and reentrancy requirements of ArcObjects in multi-threaded visual Java applications without relying upon the services of the COM runtime (in particular, COM marshalling). In the new architecture, Java threads do not enter the process wide COM multiple threaded apartment (MTA). Instead, ArcObjects creation and method invocation is intercepted in the Java tier and performed in a dedicated STA thread created by the Java interop to house ArcObjects. The advantage of this new architecture is vastly improved performance for fine-grained methods calls on ArcObjects, and the ability to create and use ArcObjects that did not have marshalling related infrastructure (that is, proxy-stub dynamic-link libraries [DLLs] for components that did not rely upon type library marshalling).

Performance improvements

At ArcGIS 10, the performance of Java applications has been improved in the following significant ways:
[Java]
System.setProperty("ARCGIS_OPTIMIZED_CASTING", "");
EngineInitializer.initializeEngine();

You can also set this property using java -DARCGIS_OPTIMIZED_CASTING or by passing it in as a VM argument. A side effect of this benefit is that developers must pay careful attention in their use of the instanceof and casting operators when programming with ArcObjects. In particular, Java casts and instanceof operators will not work for ArcObjects that have a non-deprecated constructor (a constructor that takes an object as its only argument to convert that object to the type of that ArcObjects).

To help quantify some of the performance improvements, see the following illustrations that show the performance improvements observed in representative applications:

 

New packages for arcobjects.jar

The following new packages have been added to the arcobjects.jar file:

Enhancements to existing packages

Various packages have been updated with new interfaces and classes. The following sections provide an overview of the key enhancements.

arcmapui

The ITableWindow3 interface has been added to the com.esri.arcgis.arcmapui package. This interface has three methods—isOpen(), findOpenTableWindows(), and getActiveWindowTable()—to interrogate active table windows in ArcMap.

carto

The MosaicLayer class for displaying mosaic datasets has been added to the com.esri.arcgis.Carto package.

controls

The following enhancements have been made to the com.esri.arcgis.controls package:

datasourcesraster

The following enhancements have been made to the DataSources packages:

display

The following enhancement has been made to the com.esri.arcgis.display package:

framework

The following interfaces have been added to support dockable windows:

geodatabase

The following enhancements have been made to the com.esri.arcgis.geodatabase package:

geometry

The following enhancements have been made to the geometry library:

location

The following interfaces and classes have been added to the com.esri.arcgis.location package:

networkanalyst

The following enhancements have been made to the com.esri.arcgis.networkanalyst package:

schematic

The schematic package adopts a new architecture to simplify development and to take advantage of standard ArcGIS features. In the new architecture, the NGO engine which handled the schematic graphical core and formed the foundation for the in-memory schematic objects has been removed. Some of the significant improvements in the new architecture are:

systemUI

The IToolPalette interface has been added to the com.esri.arcgis.systemUI package to define the attributes of a custom tool palette.

Deprecated or removed

The following sections describe items that have been deprecated or removed.

Eclipse documentation plug-in

The Eclipse documentation plug-in, deprecated at 9.3.1, has been removed at this release. It is still possible to get the documentation within Eclipse through an alternative workflow. For more information, see How to install ArcGIS plug-ins.

arcgisant

Ant is a powerful build tool for Java projects. In previous releases of ArcGIS, the use of a custom tool, arcgisant, was supported when working with the Java SDK samples. At ArcGIS 10, this approach has been deprecated. Beyond ArcGIS 10, ESRI will not ship the arcgisant product or the associated build files for samples. Samples will continue to be supported through the Eclipse IDE and executable Java Archive files (JARs).

RegTool

In the previous release, RegTool was an alternative approach to Java extension registration that provided a Java API, and command line tool that could be used to explicitly register and unregister Java extensions on a machine. This API and commend line tool has been removed from ArcGIS 10. Copy extension JARs to the well-know run time locations as the only workflow. See the following:

arcweb package

ESRI no longer offers the ArcWeb Services product line, and the ArcWeb package and its classes, interfaces, and methods have been removed. Any application that references the ArcWeb package cannot be migrated to 10 until and unless the references are removed. The alternative for ArcWeb services is ArcGIS Online Services.

Survey Analyst extension

The Survey Analyst extension, deprecated at 9.3.1, has been removed at this release and the subsequent SurveyDataEx, SurveyExt, and SurveyPkgs packages have been removed. The functionality of the Survey Analyst extension is now available through the Parcel Editor and Parcel Fabric features.






Development licensingDeployment licensing
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced
Engine Developer KitEngine