Code Monkey home page Code Monkey logo

Comments (4)

liao-hao avatar liao-hao commented on June 5, 2024

肯定是aop

from ruoyi-vue-pro.

wankaiyi avatar wankaiyi commented on June 5, 2024

肯定是aop

spring boot的aop现在都是用代理实现的,ControllerAdvice连代理都不是,为什么是aop呢

from ruoyi-vue-pro.

liao-hao avatar liao-hao commented on June 5, 2024

ai是个好东西:

在Spring框架中,AOP(面向切面编程)的实现通常是通过代理来完成的。但是,AOP的概念并不仅限于代理。AOP是一种编程范式,其核心**是将那些与业务无关,但在多个地方被重复使用的代码(例如日志、事务管理、安全检查等),抽取出来,形成一个独立的模块,这个模块就是切面(Aspect)。

在Spring MVC中,@ControllerAdvice注解可以被视为一种AOP的应用,虽然它并不是通过代理来实现的。@ControllerAdvice注解可以定义全局的异常处理器,这个处理器可以捕获所有控制器抛出的异常。这就是一种横切关注点(Cross-cutting Concerns)的体现,也就是AOP的核心**。

所以,即使@ControllerAdvice并不是通过代理来实现的,但是它的功能(全局异常处理)符合AOP的概念,因此我们可以将其视为AOP的一种应用。

from ruoyi-vue-pro.

YunaiV avatar YunaiV commented on June 5, 2024

https://doc.iocoder.cn/exception/

from ruoyi-vue-pro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.