一种轻量级的AOP容器实现方法  

A Lightweight AOP Container Implementation Approach

在线阅读下载全文

作  者:刘海青 LIU Hai-qing(Duolun Technology Corporation Ltd, Nanjing, China, 21110)

机构地区:[1]多伦科技股份有限公司,江苏南京211100

出  处:《软件》2018年第3期136-140,共5页Software

摘  要:AOP(面向方面编程),所谓"方面",简单地说,就是将那些与业务无关,却为业务模块所共同调用的逻辑或责任封装起来,便于减少系统的重复代码,降低模块间的耦合度,并有利于未来的可操作性和可维护性。目前AOP多用代理的方式实现。以Spring为例,框架在核心业务组件对象外封装一个代理对象,并且在调用方法外封装了一层调用方法,将横切业务逻辑插入外部代理对象的调用方法中,以此实现AOP逻辑。这种实现方式显得笨重而又繁琐。本文将提供一种对AOP实现方法的改进,通过对Io C容器的改进,建立核心业务组件的通用接口,通过将横切业务组件直接插入核心业务组件通用接口的方式,来实现轻量级的AOP框架。这种实现方式完全满足AOP的业务需求,远比代理方式实现简单,并且更接近于AOP其原始概念,其中的关键是改进了Io C框架核心业务组件的调用方式,建立通用调用接口。AOP(aspect oriented programming), the so-called "hand", simply said, is that nothing to do with the business, but for business logic or common module call responsibility package, to reduce duplication of system code, reduce the degree of coupling between modules, and is conducive to the future of the operability and maintainability. At present, AOP is implemented in the way of proxy. Taking Spring as an example, the framework encapsulates a proxy object outside the core business component object, and encapsulates a calling method outside the calling method, inserting crosscutting business logic into the calling method of external proxy object, so as to achieve AOP logic. This way of realizing is cumbersome and cumbersome. This paper will provide an improvement on the implementation of AOP. By improving the Io C container, we build a general interface of core business components, and achieve a lightweight AOP framework by directly inserting the crosscutting business components directly into the core business component common interface. This implementation fully meets the business needs of AOP, far simpler than the proxy mode, and is closer to the original concept of AOP. The key is to improve the calling way of the core business component of Io C framework, and establish the general calling interface.

关 键 词:面向方面编程 业务组件 轻量级AOP框架 

分 类 号:TP311.11[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象