Getting started – Pitney Bowes MapXtreme User Manual

Page 495

Advertising
background image

Appendix D: Extensible Data Providers

Getting Started

MapXtreme v7.1

502

Developer Guide

Most data provider implementations will contain a data source; however, this concept is not required.
Data providers for file based formats may contain only a table model. MapInfo tables and ESRI
Shapefiles are examples of data providers that do not require a connection to a data source.

Table

A table is a set of features that have the same schema (or set of columns). Tables do not have to
have a geometry property; however, it is likely that if you are building a data provider you probably
have a geometry property on some of your tables. Geometry data is treated by MapXtreme as a
column on a table just like other columns with simpler data types like strings or numbers.

The table exposes metadata to describe the data it contains and provides access to query and edit
that data. Every feature in a table must be uniquely identified by the data provider using a key. Keys
are used by MapXtreme for selections, result sets, and for editing operations.

Cursor

A cursor is an object that enumerates through a set of features. MapXtreme will request features
from the data provider by calling one of the search methods on the table. The table will return a
cursor that will allow MapXtreme to enumerate through the features that satisfy the criteria specified.
Features that are returned through cursors are expected to be transient. That means that the data
that is obtained from the current feature is assumed to be only valid while the cursor is open and
positioned on that current record. Once the position of the cursor is changed (by moving to the next
feature or by closing the cursor), then that feature is no longer assumed to be accessible. Robust
and scalable data provider implementations should be able to use the transient nature of the cursor
model to reuse memory, especially for returning FeatureGeometry objects.

A feature accessor is a special type of cursor that is used to access features by key. Any time
MapXtreme needs to access one or more features by key, it will request a feature accessor and then
request the features from it. The same transient expectations described for a cursor hold for a
feature accessor.

Getting Started

Now that you have decided to go ahead and extend MapXtreme’s data provider model, your first
question is likely "Where do I begin."

Where do I begin?

We recommend that you start by reviewing this entire appendix and the reference implementation to
familiarize yourself with the concepts and how they related to each other. When you are ready to
begin, start by building a very simple data provider in order to get a good understanding of the
requirements this undertaking involves. Even if your ultimate data provider needs are extensive,
building a basic data provider using only the required elements will provide you with a good
understanding of the data model.

The bare minimum elements are provided in the sections

Required Components

. Study the

Extensible Data Provider Overview

to understand how the various interfaces relate to each other

and to MapXtreme’s data access model. Review the provided

Sample: COTW (Center of the

Advertising