I have a core data entity called Product which is initially populated when the user first logs into the application. It can then be loaded again, if the user requests a refresh.

The Product entity is queried at several places in the app. So, I decided to implement a simple cache that can be shared across the app. The cache keeps the Product NSManagedObjects 
in a map. Is this a bad idea? 

The ProductCache class:
-----------------------

```
@interface ProductCache ()
@end

@implementation ProductCache {

}
static NSDictionary *productsDictionary = nil;
static ProductCache *sharedInstance;

+ (ProductCache *)sharedInstance {
    @synchronized (self) {
        if (sharedInstance == nil) {
            sharedInstance = [[self alloc] init];
            [sharedInstance reload];
        }
    }
    return sharedInstance;
}

- (void) reload{
    NSMutableDictionary *productsMap = [[NSMutableDictionary alloc] init];
    CIAppDelegate *delegate = (CIAppDelegate *) [UIApplication sharedApplication].delegate;
    NSManagedObjectContext *managedObjectContext = delegate.managedObjectContext;
    NSArray *allProducts = [CoreDataManager getProducts:managedObjectContext];
    for (Product *product in allProducts) {
        [productsMap setObject:product forKey:product.productId];
    }
    productsDictionary = productsMap;
}

- (NSArray *)allProducts{
    return [productsDictionary allValues];
}

- (Product *) productForId:(NSNumber *)productId {
    return productId ? [productsDictionary objectForKey:productId] : nil;
}

@end

```