Where appropriate, Core Data is used to persist model data between user sessions. The Core Data schema is defined in the MobileCommerce.xcdatamodel
file, located with the model objects in the Model directory. Data that is stored using Core Data is persistent between sessions, and only data that changes infrequently and is not user-specific is stored in this way, for example, product data and store (brick-and-mortar store) data are stored in this manner. Cache invalidation is done simply based on time, and the configuration settings can be found in the corresponding manager classes:
Product data storage timeout is configured by
PRODUCT_CACHE_TIME_OUT_SEC
in theATGProductManager
class.Store data storage timeout is configured by
STORE_CACHE_TIME_OUT_SEC
in theATGStoreManager
class.
The generated model classes, instances of which are cached with Core Data, are implementations of the ATGEntity
interface. Their definitions are all found in the CoreData
directory underneath the Model directory. Customizations to those generated classes are done using Objective-C categories. An example of this can be found in ATGProduct+Additions.h
and its corresponding implementation file.