Here is a new .NET utility that you might find useful. The API Evaluator is a tool that allows you to scan your ArcGIS .NET code and generate statistics on the API usage. It also provides you with a mechanism to send feedback directly to ESRI about the APIs that are most important to you. Read on if you would like to know more.
How it works
The API Evaluator allows you to browse to a .NET .exe or .dll, scan the code, and identify all of the calls to ESRI types. The report and statistics are returned to you in an interactive Results Viewer window. This information reveals the following:
1. The .NET assembly references found;
2. The assembly version;
3. The ESRI types called; and,
4. The number of times a call is made to each interface, property and method.
Scenario: Exploring the unknown…
You download a large code sample and know very little about how the code was written or what types are referenced. Simply use the New Scan option to step you through the scanning wizard browse to the assembly and generate statistics. Use the Results Viewer to and expand the treeview and view the number of calls to each item.
Evaluating the Results
The API Evaluator revealed that the code makes a total of nineteen calls to ESRI objects, from five libraries: DataSourcesGDB, GeoAnalyst, Geodatabase, SpatialAnalyst and System. Two of the calls are made to objects in the SpatialAnalyst library. All of this information is recorded and displayed in the Results Viewer.
So why is this important?
In this case, the tool revealed that SpatialAnalyst types are called, and therefore, the code will require clients to check out a SpatialAnalyst license at runtime.
I’m sure you can think of many different uses for this tool, but in general, a developer could use this tool to:
1. Determine the general API usage for larger or unknown code samples;
2. Determine the license-level required for an application;
3. Refactor and improve your own code where redundant calls are identified;
4. Detect library dependencies to help with deployment scenarios.
5. Detect version dependencies.
BONUS – Send us your feedback!
As an added bonus, the tool also allows you to upload your scan results directly to the ESRI Development Team. When you upload, you have the option of providing your contact details before the information is sent to a web service hosted here at ESRI. Once received, your statistics will be analyzed further to:
1. Better understand the APIs that our customers are using (most popular).
2. Make improvements to focused areas of the documentation and samples.
3. Use the information for future API development projects
For more information on the tool, you can review the documentation or download it from the Code Gallery.
Your Feedback is important
Although the “Upload Scan” functionality 100% optional, we appreciate all feedback from the developer community, so we hope you find this tool useful and you can spend a few minutes uploading the results back to ESRI.
Thanks again for your participation!