zno2

Spring 方法命名为啥好多用post ?

参考:
JLS
PreIncrementExpression
PostIncrementExpression

int a = 0;
a++; // post
++a; // pre

示例:

    @Test
    public void test() {
        int i = 0;
        System.out.println(i++);
        System.out.println(++i);
    }

 

意思是执行了方法之后,入参会发生改变。

换句话说这个方法会修改入参引用对应的堆的内容

 

再有:get post

get是为了获取内容

post 是为了提交内容

 

再有:"Post Your Answer"

 

再有:"post man"

 

投递,提交,等等

 

Spring 中的例子:

postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry)  // 修改org.springframework.beans.factory.support.BeanDefinitionRegistry
postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) // 修改 org.springframework.beans.factory.BeanFactory
postProcessBeforeInitialization(Object bean, String beanName) // 修改bean
postProcessAfterInitialization(Object bean, String beanName) // 修改bean

 

posted on 2023-07-13 18:01  zno2  阅读(15)  评论(0编辑  收藏  举报

导航