Last post Feb 21, 2010 05:34 PM by andymac7
Feb 20, 2010 08:13 PM|andymac7|LINK
I'm developing an application which will indicate the location of several types of buildings, for example hospitals, on a map.
I've got an assembly containing all of my business logic and within that assembly there is a Hospital class. The constructor for the class takes in the postcode and I want to obtain the latitude/longitude for that postcode to allow for accurate positioning
on the map.
I'm wondering how I should call the geocoding service and where I should do it? I was thinking it might be best to create a separate mapping assembly containing an IMappingService interface and to pass that interface to the constructor of my business object.
The thinking behind that approach is that it would allow easy mocking of the interface and I could use DI to inject a certain type of mapping service e.g. BingMappingService or GoogleMappingService.
Does anyone have any thoughts on that approach?
Feb 20, 2010 08:37 PM|thuhue|LINK
Would you have any specific questions?
Feb 21, 2010 05:34 PM|andymac7|LINK
I'm more looking for opions on whether that's a valid approach or if removing any mapping calls from the business logic would be better. They could live in the applcation services layer.