Session interface, Session management, Mapinfo.engine namespace – Pitney Bowes MapXtreme User Manual
Page 197

Chapter 9: Working with Core MapXtreme Classes
Session Interface
MapXtreme v7.1
204
Developer Guide
Session Interface
The ISession interface is the starting point for all MapXtreme-based applications. It manages the
initialization of resources needed for a MapXtreme application.
An instance of ISession holds components of the MapXtreme object model such as the DataAccess
engine, MapFactory, CoordSysFactory so that the desktop or web application can do work. The
following diagram illustrates the classes that implement ISession interface.
For an ASP.NET application each client request has its own ISession instance. This instance resides
in the calling context and is available throughout the lifetime of the client's request.
For a single-threaded desktop application there is only one instance. On a multi-threaded desktop
application there is one instance per thread.
The MapInfo.Engine.Session class provides access to the ISession object. To get the current
ISession instance, access the MapInfo.Engine.Session.Current property.
Session Management
Session management is a key topic to understand when you are designing your application. While a
desktop application’s session management is straightforward (each user has his own ISession
instance), a web application needs to factor in, perhaps, an unknown number of users who will user
your application. It will have to know how to handle each user’s state so that the correct information
and visual display is returned to the correct user.
MapXtreme provides templates for building web applications that help you manage state properly.
This topic is discussed in greater detail in
Chapter 6: Understanding State Management
decisions about state management, pooling, performance and data access are presented to help
you make informed decisions during the design phase of your project, before you start coding.