Planning a desktop application, Best practices for desktop applications, Mapxtreme and com – Pitney Bowes MapXtreme User Manual

Page 125

Advertising
background image

Chapter 7: Desktop Applications, Controls, Dialogs, and Tools

Planning a Desktop Application

MapXtreme v7.1

125

Developer Guide

Planning a Desktop Application

MapXtreme is a .NET-based object model that exposes mapping functionality to any .NET-based
development work. There are many emerging technologies that can be used to develop applications
using the .NET framework.

Desktop applications provide a rich tool interaction for the user. While web applications are getting
more sophisticated, applications designed for the desktop still have the advantage. For example,
desktop applications have a “snap to node” capability that can be useful when placing a Point
feature exactly at the intersection of the street. Desktop applications also offer InfoTips as you hover
the mouse pointer.

If you have an existing WinForms or other .NET-based application framework, you can simply start
integrating the MapXtreme classes into your application. The MapXtreme object model is a fully
compliant .NET object model, so you have the full power and functionality of the .NET framework to
interact with our object model. Simply develop your application in the mode defined by your
application framework and reference the MapXtreme objects.

Best Practices for Desktop Applications

The MapXtreme MaForm Application template is designed for rapid prototyping only, since it only
references the MapXtreme assemblies. Use this as a starting point for a quick demonstration or
proof of concept.

WinForms and the .NET framework provide basic support for single document (SDI) and multiple
document interface (MDI) based applications. WinForms does not provide an application framework
comparable to Microsoft Foundation Classes (MFC). It is missing document view, data exchange,
and other MFC-based user interface concepts.

However, Microsoft does provide its Composite UI Application Block (CAB), as a way of encouraging
their recommended patterns and practices. Note that the Composite UI Application Block is
available for .NET 2.0 Framework and above. More information is available at the Microsoft
Developer Network website at

msdn2.microsoft.com/en-us/library/aa480450.aspx

.

A very important aspect of the .NET development model is the separation of business logic from
presentation. MapXtreme uses this paradigm in its controls to allow the user to open a dialog with a
copy of the object to be modified. In this way, the dialog is not directly editing your runtime objects
and you can create a new object in another process or machine and pass back the serialized version
for use by your application.

MapXtreme and COM

.NET does not mean the end of COM. Many development shops put a great deal of effort into the
COM object model and have a large investment that can't simply be discarded. So what is the best
method of developing applications that have COM objects?

It is more likely that new .NET code will have to interoperate with existing COM code (rather than the
reverse situation), so we will focus on this scenario. A .NET client accesses a COM server through a
runtime-callable wrapper (RCW). The RCW wraps the COM object and mediates between it and the

Advertising