您的位置:首页 > 编程语言 > Java开发

Spring AOP面向切面编程

2017-09-16 09:20 459 查看
11. Aspect Oriented Programming with Spring
11.1 Introduction
Aspect-Oriented Programming (AOP) complements Object-Oriented Programming (OOP) by providing

another way of thinking about program structure. The key unit of modularity in OOP is the class, whereas

in AOP the unit of modularity is the aspect. Aspects enable the modularization of concerns such as

transaction management that cut across multiple types and objects. (Such concerns are often termed
crosscutting concerns in AOP literature.)

One of the key components of Spring is the AOP framework. While the Spring IoC container does not

depend on AOP, meaning you do not need to use AOP if you don’t want to, AOP complements Spring

IoC to provide a very capable middleware solution.

面向切面编程(AOP)是对面向对象编程(OOP)的一种完善,提供了另一种思考程序架构的方式。OOP的核心模块单元是类,然而在AOP中核心模块单元是切面。切面可以使模块更加关注从各种类型和对象中抽取的事物管理。

AOP是Spring中关键的组件旨之一。但是Spring IOC容器不依赖于AOP,意味这如果你不想使用AOP的话可以没必要添加这个模块。AOP完善了Spring IOC提供了很好的中间件解决思路。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息