到 Google 资讯主页   
EasyJF首页   资料   源码   软件    论坛   网站    
   使用帮助    
    该信息为本站MyRSS系统缓存内容,部分图片及附件有可能无法正常使用.easyjf.comwww.matrix.org.cn无关,不对该信息负责.通过http://www.matrix.org.cn//resource/article/0/181.html访问该信息的原始内容.
页面功能  【加入收藏】 【推荐给朋友】 【字体:  】 【关闭】   
AOP中的主要技术(二)
作者:chris 来源:www.matrix.org.cn  发布时间:2006-02-22 17:48:49.517

Session Pool Design

1. 利用apache common-pool实现一个Session Pool(非常简单)
2. 如何避免代码中的returnObject()?

       xxx()            invoke
        --------> PoolProxy ---> PoolInterceptor      SessionPool
                                           borrowObject()
                                          --------------->
                                          <---------------


                                                   xxx()       Session (be borr
owed)
                                          -------------------------------->

                                           returnObject()
                                          ---------------->


--

RMI design

xxx()            invoke               Serialize call to remote
-----> ClientProxy ---> RmiInterceptor ------------------->

         find ServerProxy, xxx()               xxx()
RmiServer----------------> ServerProxy --->....-->ServerObject

Method Cache design

1.用HashMap做cache

xxx()       invoke
-----> Proxy ---> MCInterceptor
                       1. get Attribute @timeout
                       2. 用object[]作为key,看cache中的
                       结果是否超时

                       3. 如果超时     invoke
                         ------------------> NextInterceptor...
                       4. 如果不超,返回被cache的结果
Draw activity UML diagram:

1. 实现绘图模块
xxx()      invoke
---> Proxy ---> ActivityIntercpetor
                             draw xxx()
                        --------------->绘图模块
                            invoke
                        --------------------------->NextInterceptor...

Persistence and descriptive transaction

1. Persistence直接使用hibernate


xxx       invoke
---->Proxy-->HibernateInterceptor
                                1. 取得@tx,应该为required,requiresnew
                                ,supports,notsupported中的一种
                                2. 判断当前的transaction状态
                                3. 决定本次调用是否在transaction当中
Folder-Node关系的复用


getFolder()   getFolder()         invoke              getFolder()
  --->UserProxy ------> NodeProxy -->SideEntityInterceptor--> Node
                                                        return Folder
                                                        <-----
                                             根据Folder创建Group proxy
                                  返回GroupProxy
                                  <----


in the code, like this:

...
User user = userFactory.find("guty"); //user is actually a proxy
Group group = (Group)((Node)user).getFolder();

 
相关文章
 
页面功能  【加入收藏】 【推荐给朋友】 【字体:  】 【关闭】   


EasyJF.com 2006 隐私政策 使用EasyJF前必读