Giter Site home page Giter Site logo

Comments (4)

QilongZhang avatar QilongZhang commented on August 15, 2024

非常感谢,你的分析是对的。 ServiceAnnotationBeanPostProcessorsofaRuntimeProperties 的依赖在另一个即将提的PR中已经剥离了,剥离的原因是因为开发另一个特性,碰巧也把你指出的这个问题规避了。 不过仍然非常希望你针对这个问题给我们提Fix PR。 @ScienJus

from sofa-boot.

ScienJus avatar ScienJus commented on August 15, 2024

Hi @QilongZhang ,按照目前的现状,我认为最轻量级的方式就是解除 ServiceAnnotationBeanPostProcessorSofaRuntimeProperties 的强绑定,而是改为在执行时通过 ApplicationContext(BeanFactory)#getBean 的弱绑定。

不知道你是否认同这种修复方案,以及是否有更好的方案?没有的话我会提交一个 PR 以及补充一些简单的测试。

注:其实这个 case 还是影响面很小的,不过在 BeanPostProcessor 使用其他 Bean 导致的加载顺序问题一不小心就会发生,而且用户 debug 还会很麻烦,所以以这个 case 举例介绍下。

from sofa-boot.

QilongZhang avatar QilongZhang commented on August 15, 2024

@ScienJus 首先感谢。正常情况下,你说的解决方案是可行的。因为另一个在开发的特性,会有一个限制,ReferenceComponentReferenceRegisterHelper 这两个类,不能直接或间接使用到任何spring相关的类。 目前代码中这两个类都是直接使用 SofaRuntimeProperties 这个类,因为这个类会依赖spring相关类,因此需要剥离。你的方案只需要保证不违背这点限制就好了。

from sofa-boot.

ScienJus avatar ScienJus commented on August 15, 2024

@QilongZhang 目前只是在 ServiceAnnotationBeanPostProcessor 中修改了获取 SofaRuntimePropertiesSofaRuntimeContext,基本没动其他类,所以应该不会影响对其他类的重构?上面提到的两个类的剥离应该 rebase 后不会有冲突,希望如此…

from sofa-boot.

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.