Back to list
Views:   0
Replies:  0
Archived
,
Reply 1
Parity Bit: 

Good question.

Once a change is made (for example an Artist is updated or a new Artist is added) you have these options: 

  1. Manually add the new Artist to the Cache or update the one already in cache, or 
  2. Clear the entire Artist cache. (You will find a ClearArtists method in the ArtCache that handles this for you)

The last method is the simplest and also the preferred way. Note that the cache will refill automatically through the lazy loading mechanism. 

The first method should only be used if your cache is very large and/or frequent updates take place (essentially you want to avoid frequent large database selects).  If you choose to use method 1. then remember to place locks around the critical code to maintain thread safety. 

By the way: you can add the extra code that interacts with the cache in your code behind or (even better) in the service layer. 
There is no need move it to the Domain project because caching here is rather application specific. (I would only move it to the Domain project if caching were a cross-cutting concern in which you wish to automatically cache just about all tables. In that case there are probably better 3rd party solutions to do that). 

Hope this helps. 
Jack Poorte



Jack Poorte, Sep 26, 2013
Thanks for taking the time to reply but I still don't know what the design has to do with cloud? What makes this app "portable" to the could? The n-tier design or the actual service? Thanks
Jul 25, 2012
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas