Wednesday, July 03, 2013

Wish List App Part 1

The Visual Studio templates for Windows store apps are pretty deep.  They probably do much more than most people want but they do get something up immediately which is great.  Run the template, rename a few things and you have a running app - I can see Wish Lists!

The big plus for me here is that all the XAML has been written for me.

The next step though is to look into the Share contract.  There is a template for that!  Pretty soon after that though we get to the issue that we need to persist our wish lists in some way.  The obvious way is probably in the cloud but I want the ability to work off the net and want to keep it local for now.  The next obvious solution is to use the serialization capabilities to turn the wish list into XML and store it on the local disk.  I want to wrap that up in an abstraction so that I can sync with the cloud or just save straight to the cloud at a later date.  I like the concepts in DDD here so will use the Repository pattern for my data model.  Note also that XML Serialization is not supporting in store apps but the DataContract serialization is.  I love unit test too so I start by creating a unit test project and start implementing my Repository.

The first noticeable difference is the use of the async methods.  Any operations that might take a while should be asynchronous so that the user does not have to wait.  This is already very simple with the async keyword that propagates around your code.  Just make sure that in your tests you wait for these tasks so that things happen in the order you expect them to.

0 Comments:

Post a Comment

<< Home