Another topic we need to consider is which new features we require from the data service. Since we will be using an external camera app to capture the picture, we will have it save the picture in the same location as the JSON using a naming scheme like poiimage<id>.jpg
. The data service will not be responsible for saving the images, but it would be convenient for it to provide a location and filename. Also, since the data service deletes POIs, it would be a good idea for it to also delete corresponding POI images, if they exist.
As we previously mentioned, the filename and location is something we should obtain from the data service. To do so, we will first add a method to the IPOIDataService
interface and then implement it in POIJsonServices
. The following listing shows the method we need to add to IPOIDataService
:
public interface IPOIDataService { ... string GetImageFilename (int id); }