![](http://www.fwic.net/Portals/3/MBS_AvatarHead.png)
My most recent App, Border Wait Times, uses data. That data is pulled from at least two sources, the US Customs and Border Protection (CBP) who kindly provide an easy to digest XML formatted document containing border wait times for key crossings and the Canada Border Services Agency (CBSA) who give you an html page that you better hope never changes.
The Setup
Now, the easy thing to do would be just to have my App run off to their respective web sites, process it and splat in some user’s phone and hope and pray that the data formats never change. Getting data directly from the horse’s mouth is easy, it just isn’t necessarily smart. When I designed the app, I actually did what I usually do, went lazy, and that turned out to be a very good idea for several reasons, some of which I haven’t even taken advantage of yet.
The Model
![](http://www.fwic.net/Portals/3/BorderWaitTimes/FromUS_NY_v1_1(2)%20400.png)
I setup the Border Wait Times to just call MY web service instead of direct through to the CBP and CBSA. In my App, I just used the same WebClient() object (Asynchronously of course) to get the data from our server here. Piece of cake.
The Hallelujahs!
Ok, so, why did doing this produce a big win and a recommendation that you should do it too? Of course, this is assuming that your application needs external data from somewhere that you might not control.
Consistency of Format
I always know exactly what format the data that I get from the web service will look like. No matter what CBP or CBSA
does to their data, my App knows what to expect. If CBP or CBSA changes their data format, no problem, I just update our web service right here in my office and I don’t have to submit any updates at all to the Marketplace. The App will just work. The other day, I encountered just such a change, although it would not have been noticeable, within minutes I had updated our web service and corrected the data. The Windows Phone owner never had to do a blessed thing! Sweet!
![](http://www.fwic.net/Portals/3/BorderWaitXML.png)
Another example, we received a support request asking if a particular border crossing that wasn’t showing in our App could be included. Again, we just went back to the web service, included another data source and were able to provide the border crossing to the user on the same day the request was made. The same thing works for the new Border Cam feature we just introduced. If we get a request to add a Border Cam, we can also do that without any update to the App in the Marketplace.
Conservation of Data Bandwidth
![](http://www.fwic.net/Portals/3/BorderWaitTimes/CBP%20BorderWaitXML.png)
Performance
Well first, transmitting 1/7th the amount of data is going to be faster. Next, because the CBSA and the CBP only update their data once every 60 minutes, there really isn’t a lot of need to make lots of round trips. If the data hasn’t changed just send it to the phone. This can be a big time saver. And the nice thing is it’s all controlled on our web service server and I can change it anytime things change without having to bother the phone user with an update.
Scalability
What if all of a sudden Windows Phone took off? What if suddenly a few hundred thousand downloaded my app? Now consider that they all are checking the border at the same time? Do you think it might slow things down? You don’t know how much traffic the government web sites that give you your data can handle. Right now we host the web service on our own server. But we did design things so that if there was greater demand, we could just shuffle it off to an Azure Cloud instance and then “ta da” instant scalability and no worries.
Customizability
And one other little tidbit. Some of the information I need for a more complete App is just not provided by the CBP or CBSA. No problem, with a web service I can add the information from another source or from a new source that we created for the purpose. Either way, it allows us to offer things like Directions and Border Cams that we could not otherwise provide.
The End
Basically the big benefit I saw immediately was the ability to assist a customer who wanted an enhancement WITHOUT having to go through a development cycle including re-certification in the App Marketplace. The other benefit was a change in the data format. If I couldn’t fix that on the fly then I might have racked up a whole bunch of negative reviews waiting for the slow tick on the Windows Phone App Marketplace certification team.
Anything that saves my bacon is just a good thing.See it in action with Border Wait Times
No comments:
Post a Comment