We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://msdn.microsoft.com/en-us/library/dn589799.aspx
This pattern could be incorporated into https://github.com/iluwatar/java-design-patterns/tree/master/caching example.
The text was updated successfully, but these errors were encountered:
Thanks for an excellent project, I thought I should contribute something back and this one seemed like a low-hanging fruit.
Would it make sense to simply add two helper methods in AppManager, e.g. saveAside and findAside
saveAside
findAside
private static void saveAside(UserAccount userAccount) { DbManager.updateDb(userAccount); CacheStore.invalidate(userAccount.getUserId()); }
and then either delegate CacheStore.(get,set,invalidate) to cache
CacheStore.(get,set,invalidate)
cache
public static void invalidate(String userId) { cache.invalidate(userId); }
or simply expose cache with a CacheStore.getCache() getter?
CacheStore.getCache()
And then add a new case:
public static void save(UserAccount userAccount) { if (cachingPolicy == CachingPolicy.THROUGH) { CacheStore.writeThrough(userAccount); } else if (cachingPolicy == CachingPolicy.AROUND) { CacheStore.writeAround(userAccount); } else if (cachingPolicy == CachingPolicy.BEHIND) { CacheStore.writeBehind(userAccount); } else if (cachingPolicy == CachingPolicy.ASIDE) { saveAside(userAccount); }
Would that make sense, @iluwatar?
Sorry, something went wrong.
@christofferh the plan looks reasonable. Just create a pull request and we'll review.
No branches or pull requests
https://msdn.microsoft.com/en-us/library/dn589799.aspx
This pattern could be incorporated into https://github.com/iluwatar/java-design-patterns/tree/master/caching example.
The text was updated successfully, but these errors were encountered: