I've been tasked with writing a web service that can be called from one of our two plant locations that will allow our shipping department to get the most efficient route for a set of deliveries. We've also discussed the possibility of setting up territories and assigning deliveries to territories and territories to drivers.
My question, in its simplest form, is this: MapPoint 2011 allows you to use its object model through COM. I'm not terribly familiar with this type of programming but it seems to create a new instance of the application each time the logic is called. Is this type of usage scalable? What will happen if ten calls are received simultaneously?
I've included some sample code pulled from MSDN below as a point of reference.
//set up application
MapPoint.Application objApp = new Application();
objApp.Visible = false;
objApp.UserControl = false;
MapPoint.Route objRoute;
MapPoint.Map objMap;
objMap = objApp.ActiveMap;
objRoute = objMap.ActiveRoute;
objMap.Parent.PaneState = MapPoint.GeoPaneState.geoPaneRoutePlanner;
//Get locations for route
object item = 1;
objRoute.Waypoints.Add(objMap.FindResults("Redmond, WA").get_Item(ref item),
"Redmond, WA");
objRoute.Waypoints.Add(objMap.FindResults("Seattle, WA").get_Item(ref item),
"Seattle, WA");
objRoute.Waypoints.Add(objMap.FindResults("Portland, OR").get_Item(ref item),
"Portland, OR");
// Calculate the route
objRoute.Calculate();
//Asks if you want to save the map? How would you say no programmatically?
objApp.Quit();