Показать сообщение отдельно
Старый 06.08.2010, 17:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
Pawan's Ax blog: How To Cache A object Globally in Ax
Источник: http://pawansaxblog.blogspot.com/201...lly-in-ax.html
==============

There are three way to cache objects.

A global cache is an instance of class - SysGlobalCache, which is nothing but a Map containing Maps with a Key. These Maps contain the actual value and a key.
In Ax, we have three Global Cache Classes

1.Infolog.globalCache()

2.Appl.globalCache()

3. ClassFactory.GlobalCache().

How to use:

X++:
static void GlobalCacheSetAndGet(Args _args)
{
       SysGlobalCache globalCache;
       class          test;
       ;

      globalCache = infolog.globalCache();

     if (globalCache.isSet(classstr(test), 0))
     {
        test= globalCache.get(classstr(Test), 0);
        return test;
     }
    else
    {
        test= new test();
        globalCache.set(classstr(Test), 0, test);
        return test;
    }

}



Источник: http://pawansaxblog.blogspot.com/201...lly-in-ax.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.