title: Approach for disconnected application development
body: <p>Our company has people in every catastrophic event here in the U.S. and parts of Canada.  An example is they were quite prevalent in Katrina immediately after the event.</p>
  
  <p>We are constructing an application to improve their job in the field which may be either ASP.NET or WPF, and the disconnect requirement makes us believe it will be a WPF application.  Our people need to be able to create their jobs, provide all of the insurance and measurement data, and save it as if in the database whether or not the internet is available.  </p>
  
  <p>The issue we are trying to get our heads around is that when at catastrophic events our people need to be able to use our new application even when the internet is not available.  (They were offline for 3 days in Katrina)</p>
  
  <p>Has anyone else had to address requirements like this and suggestions on how they approached functioning on small-footprint devices while saving data as if they were still connected to the backend services and database?  We also have to incorporate security into this as well, and do it well enough that their entered data loads into the connected database without issues.</p>
  
  <p>Our longterm goal is to also provide this application for Android and IPad Tablet devices as well as laptops.  Our initial desire for ASP.NET was it gave us an immediate application for the tablet environment.  In the old application they have, they run a local server, run remote connections on the tablets and run the application through terminal server.  Not pretty.  Not pretty.</p>
  
  <p>I feel this is a serious question that is not subjective so hopefully this won't get deleted.  </p>
  
  <p>Our current architecture on the server side is Entity Framework with a repository pattern, WCF services to satisfy CRUD requests returning composite data transfer objects, and a proxy for use by the clients.  </p>
  
  <p>I'm interested in hearing other developers' input and this design puzzle.</p>
  
  <p><strong>Additional Information Added to the Discussion</strong></p>
  
  <p>Lots of good information provided!!!  I'll have to look at Microsoft Sync for sure.  For the disconnected database I would be placing only list tables (enumerations) in the initial database.  Jobs and, if needed, an item we call dry books, will be added for each client we are helping.  (though I hope the internet returns by the time we are cleaning and drying out the homes)  These are the tables that would then populate back to the host once we have a stable link.  In the case of Katrina we also lost internet connectivity in our offices which meant the office provided no communication relief for days as well.</p>
  
  <p>Last night I realized that our client proxy is the key to everything working!  The client remains unaware of the fact that it is online or offline and leaves the synchronization process within that library.  We are discovering how much data we are talking about today.  I also want to make it clear that ASP.NET was a like-to-have but a thick client (actually WPF with XAML) may end up being our end state.</p>
  
  <p>Now -- for multiple updates.  The disconnected work will be going to individual homes by a single franchise.  In fact our home office dispatches specific franchises to specific events.  So we have a reduced likelihood (if any) of the problem of multiple people updating a record.  The reason is that they are creating records for each job (person's home/office/business) and only that one franchise will deal with it.  Of course this also means that if they are disconnected for days that the device that creates the job (record of who, where, condition, insurance company, etc) is also the only device that knows of the job.  But that can be lived with.  In fact we may be able to have a facility to sync the franchise devices on a hub.</p>
  
  <p>I'm looking forward to hearing additional stories of how you've implemented your disconnected environment.</p>
  
  <p>Thanks!!!</p>
  
  <p><strong>Looking at new technology from Microsoft</strong></p>
  
  <p>I was directed to look at a video from TechEd 2012 and thought I might have an answer.  The talk was on using ASP.NET and MVC4 along with 2 libraries for disconnected behavior.  At first I thought it would be great but then as it continued it worried me quite a bit.</p>
  
  <p>First the use of a javascript backend to support disconnected I/O does not generate confidence.  As a compiler guy (and one who wrote two interpretive languages) I really do not like having a critical business model reliant upon interpretive javascript.  And script at that!  It may be me but it just makes me shudder.  </p>
  
  <p>Then they show their "great"(???) programming model having your ViewModel exist as just javascript.  I do not care for an application (asp.net and javascript) that can be, and may as well be (for lack of intellisense ) written in notepad.  </p>
  
  <p>No offense meant to any asp lovers, but a well written C# program that has been syntactically and type checked gives me stronger confidence in software than something written with a hope and prayer that a class namespace has been properly typed without any means of cross check.  I've seen too many hours of debugging looking for a bug that ended up in a huge namespace with transposed ie in it's name.  I ran my thought past the other senior developers in my group and we are all in consensus on this technology.  </p>
  
  <p>But we continue to look.  (I feel this is becoming more of a diary than a question)  :)</p>