Skip to content

Instantly share code, notes, and snippets.

@matzew
Created September 20, 2012 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matzew/3757190 to your computer and use it in GitHub Desktop.
Save matzew/3757190 to your computer and use it in GitHub Desktop.
AGDataManager
/**
* AGDataManager manages different AGStore implementations. It is basically a
* factory that hides the concrete instanciation of a specific AGStore implementation.
* The class offers simple APIs to add, remove or get access to a 'data store'.
*
* NOTE: Right now, there is NO automatic data sync. This is up to the user.
*/
@interface AGDataManager : NSObject
/**
* Creates a new default (in memory) AGStore implemention.
*
* @param storeName The name of the actual data store object.
*/
-(id<AGStore>)add:(NSString*) storeName;
/**
* Creates a new AGStore implemention. The actual type is determined by the type argument.
*
* @param storeName The name of the actual data store object.
* @param type The type of the new data store object.
*/
-(id<AGStore>)add:(NSString*) storeName type:(NSString*) type;
/**
* Removes a AGStore implemention from the AGDataManager. The store to be removed
* is determined by the storeName argument.
*
* @param storeName The name of the actual data store object.
*/
-(id<AGStore>)remove:(NSString*) storeName;
/**
* Loads a given AGStore implemention, based on the given storeName argument.
*
* @param storeName The name of the actual data store object.
*/
-(id<AGStore>)get:(NSString*) storeName;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment