State management considerations – Pitney Bowes MapXtreme User Manual
Page 464

Appendix A: How to Create and Deploy a MapXtreme Application
Building a Web Application
MapXtreme v7.1
471
Developer Guide
Notice how the theme has changed with more data bins (color codings) and how the countries have
changed theme color based on the new data distribution method.
As you can see, making simple display modifications to this sample Web Application is relatively
easy. Other possible modifications to this sample include:
•
·Changing the web page layout, such as moving the controls around.
•
·Changing the web page styles such as colors and fonts.
State Management Considerations
Customizing a Web application sample not only involves changing elements of the application, but
also building it with state management best practices in mind. Because of the intricacies of handling
applications and user state in a web environment, you must understand how MapXtreme handles
them and how you can apply these concepts in your own development. State Management for Web
Applications is discussed in
Chapter 6: Understanding State Management
This sample, in terms of best practices, uses a pre-loaded workspace of maps and settings,
manages application and user state manually, and uses pooled session objects so that the
application can service multiple requests efficiently.
It is designed to detect if the user is making a first time request, in which case the application is
presented in its initial state, or if the user is revisiting the application, in which case the user’s
personal settings are maintained. Because this sample is sharing session objects with multiple users
(known as pooling), it detects if the session is in its initial state (“clean”) or contains another user’s
changes (“dirty”).
To maintain all users’ settings separately, this sample sets Session.State to manual. In a Web
application where the MapXtreme Session state is saved automatically, the Session.State would be
set to HttpSessionState. This means that the entire session is saved to the HTTP Session. Although
this option automatically saves state, performance degrades because it does not determine what to
save. The entire session is saved.