The key unit of modularity in OOP is the class, whereas in AOP the unit of modularity is the aspect.

Spring Framework Overview https://www.tutorialspoint.com/spring/spring_overview.htm

Aspect Oriented Programming (AOP)

One of the key components of Spring is the Aspect Oriented Programming (AOP) framework. The functions that span multiple points of an application are called cross-cutting concerns and these cross-cutting concerns are conceptually separate from the application's business logic. There are various common good examples of aspects including logging, declarative transactions, security, caching, etc.

The key unit of modularity in OOP is the class, whereas in AOP the unit of modularity is the aspect. DI helps you decouple your application objects from each other, while AOP helps you decouple cross-cutting concerns from the objects that they affect.

The AOP module of Spring Framework provides an aspect-oriented programming implementation allowing you to define method-interceptors and pointcuts to cleanly decouple code that implements functionality that should be separated. We will discuss more about Spring AOP concepts in a separate chapter.

 

面向类的编程 的模块的原子是类

面向切面的编程 的模块的原子是切面,类的一方面 

 

posted @ 2018-11-29 10:54  papering  阅读(241)  评论(0编辑  收藏  举报