Click here to Skip to main content
15,888,579 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Communicating the Reason for Method Failure Pin
Brady Kelly10-Mar-09 5:58
Brady Kelly10-Mar-09 5:58 
GeneralA re-introduction to TDD Pin
Brady Kelly9-Mar-09 2:09
Brady Kelly9-Mar-09 2:09 
GeneralHigh Level Design for Installation and Upgrade Application Pin
Brady Kelly6-Mar-09 8:49
Brady Kelly6-Mar-09 8:49 
GeneralRe: High Level Design for Installation and Upgrade Application Pin
Jonathan Davies8-Mar-09 4:11
Jonathan Davies8-Mar-09 4:11 
GeneralRe: High Level Design for Installation and Upgrade Application Pin
Brady Kelly8-Mar-09 4:25
Brady Kelly8-Mar-09 4:25 
GeneralRe: High Level Design for Installation and Upgrade Application Pin
Jonathan Davies8-Mar-09 5:25
Jonathan Davies8-Mar-09 5:25 
GeneralRe: High Level Design for Installation and Upgrade Application Pin
Brady Kelly8-Mar-09 5:47
Brady Kelly8-Mar-09 5:47 
QuestionCache Manager design problem Pin
Steve Holdorf28-Feb-09 9:07
Steve Holdorf28-Feb-09 9:07 
I have some basic code for a cache manager provided below. My design is far from complete and I need help. What I need is a single cache manager CacheManager.cs GetCacheItem method that accepts as parameters a cache key, business object delegate method and a variable set of parameters. This manager should be able to get and retrieve items in cache, handle dependencies, and work with every business manager object in the project (i.e. bc_CustomerManager.GetCustomer, bc_ProductManager.GetProduct, etc.) Anyone who can assist me or work with me on this would be wonderful.

Cache Manager GetCacheItem:
        public object GetCacheItem(String sCacheKey, QueryExpression QueryExpression, params object[] parameters)
        {
            object objCacheItem = null;

            if (!CachingEnabled)
            {
                return objCacheItem;
            }

            if (CacheItem<Object>(sCacheKey) != null)
            {
                return CacheItem<Object>(sCacheKey);
            }
            else
            {
                lock (syncObject)
                {
                    if (CacheItem<Object>(sCacheKey) != null)
                    {
                        return CacheItem<Object>(sCacheKey);
                    }
                    else
                    {
                        Object cacheItem = QueryExpression(parameters);

                        AddToCache<Object>(sCacheKey, cacheItem);

                        return cacheItem;
                    }
                }
            }
        }



In my project I have a business layer and a data layer. I am not sure where and how the code below should be called. Incomplete code call to CacheManager.GetCacheItem:

<pre>
        // Main delegate on which all Get requests are based on.
        delegate object QueryExpression(params object[] parameters);

        // Create instance of cacheManager
        CacheManager cacheManager = new CacheManager();

        // Create instance of BC_Assects
        BC_Assects bc_Assects = new BC_Assects();
        
        // Make the generic get cache item call GetAssetsByCollectionID must be declared as a QueryExpression delegate
        DataTable dt = (DataTable) cacheManager.GetCacheItem(sCacheKey, bc_Assects.GetAssetsByCollectionID, parameters);



Thank you very much!


Steve
QuestionRe: Cache Manager design problem [modified] Pin
Steve Holdorf28-Feb-09 14:34
Steve Holdorf28-Feb-09 14:34 
AnswerRe: Cache Manager design problem Pin
Steve Holdorf1-Mar-09 9:53
Steve Holdorf1-Mar-09 9:53 
QuestionReverse engineering the vc++ project Pin
hariakuthota19-Feb-09 22:28
hariakuthota19-Feb-09 22:28 
AnswerRe: Reverse engineering the vc++ project Pin
bobbery19-Feb-09 23:12
bobbery19-Feb-09 23:12 
AnswerRe: Reverse engineering the vc++ project Pin
Han van Roosmalen3-Mar-09 20:55
Han van Roosmalen3-Mar-09 20:55 
QuestionResource Allocation Logic Pin
Nagarajan Mohan18-Feb-09 2:52
Nagarajan Mohan18-Feb-09 2:52 
QuestionDesign question about layers and MVC Pin
Fernando A. Gomez F.14-Feb-09 11:56
Fernando A. Gomez F.14-Feb-09 11:56 
AnswerRe: Design question about layers and MVC Pin
Jonathan Davies18-Feb-09 3:11
Jonathan Davies18-Feb-09 3:11 
Question.net Serializable DTO Pin
mokrala12-Feb-09 6:14
mokrala12-Feb-09 6:14 
QuestionBuilding a relational graph from a large build enlistment Pin
Adam Dare9-Feb-09 18:01
Adam Dare9-Feb-09 18:01 
AnswerRe: Building a relational graph from a large build enlistment Pin
Jonathan Davies18-Feb-09 3:22
Jonathan Davies18-Feb-09 3:22 
GeneralRe: Building a relational graph from a large build enlistment Pin
Adam Dare18-Feb-09 4:44
Adam Dare18-Feb-09 4:44 
GeneralRe: Building a relational graph from a large build enlistment Pin
Jonathan Davies19-Feb-09 3:03
Jonathan Davies19-Feb-09 3:03 
QuestionHow to play an Animation and make video render before logon through credential provider ?(Vista) [modified] Pin
wyc_xiaoben4-Feb-09 15:07
wyc_xiaoben4-Feb-09 15:07 
QuestionWhat pattern should I use? Pin
nickiii3-Feb-09 5:17
nickiii3-Feb-09 5:17 
AnswerRe: What pattern should I use? Pin
Jon Rista3-Feb-09 10:55
Jon Rista3-Feb-09 10:55 
GeneralRe: What pattern should I use? Pin
nickiii3-Feb-09 13:01
nickiii3-Feb-09 13:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.