Going offline (Part 1) - Summary

In this article, I updated the persistence framework to better support both online and offline usage within my fishing app. The following changes were made:

  1. A generic abstract class was developed to manage some of the standard web-based operations that all services require.
  2. A business object-specific interface was defined. This interface (or protocol) provides the contract for persisting data - either locally, or on the server.
  3. A concrete class was implemented for managing online data. (Offline data will be described in the next article.)
  4. A service factory class was created to help manage the instantiation of service classes and to manage the online / offline state.
  5. The mobile app was updated to use the new persistence frameworks.

Note: This article only focused on the Location service. Additional code is required to complete the Fish, Catch, and User services, but this is left as a task to the reader - especially since the code is so similar to the Location service.

Although this article didn't add any new functionality, it better positioned me to manage the transition between online and offline modes. In the next article, I'll detail the local persistence of fishing data by using a local database - SQLite.