难道这样就够了吗?不,远远不够!
提前多熟悉阿里往年的面试题肯定是对面试有很大的帮助的,但是作为技术性职业,手里有实打实的技术才是你面对面试官最有用的利器,这是从内在散发出来的自信。
备战阿里时我花的最多的时间就是在学习技术上,占了我所有学习计划中的百分之70,这是一些我学习期间觉得还是很不错的一些学习笔记
我为什么要写这篇文章呢,其实我觉得学习是不能停下脚步的,在网络上和大家一起分享,一起讨论,不单单可以遇到更多一样的人,还可以扩大自己的眼界,学习到更多的技术,我还会在csdn、博客、掘金等网站上分享技术,这也是一种学习的方法。
今天就分享到这里了,谢谢大家的关注,以后会分享更多的干货给大家!
// https://mvnrepository.com/artifact/org.springframework/spring-context
implementation ‘org.springframework:spring-context:5.2.9.RELEASE’
========================================================================
首先你得有个spring的配置文件:
<?xml version="1.0" encoding="UTF-8"?><beans xmlns=“http://www.springframework.org/schema/beans”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xmlns:context=“http://www.springframework.org/schema/context”
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
"
<context:component-scan base-package=“com.example.spring.beans”/>
最最基础的通过xml引入spring的代码如下:
public void test1(){
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(“spring.xml”);
//student是通过bean的方式手动写入的
Object student = applicationContext.getBean(“student”);
System.out.println(student);
//teacher是通过component-scan+@Component注解结合的
Object teacher = applicationContext.getBean(“teacher”);
System.out.println(teacher);
}
BeanDefinitionRegistryPostProcessor
===================================================================================================
BeanDefinitionRegistryPostProcessor
是Spring提供的一个接口,可以用来对BeanDefinition进行增删改。
引申一下,Spring管理的所有的bean都必须生成BeanDefinition之后注册到BeanDefinitionRegistry中
我们直接看下面这段代码:
@Component
public class MyBeanDefinitionRegisterPostProcessor implements BeanDefinitionRegistryPostProcessor {
@Override
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
//从registry中获取名为student的bean的BeanDefinition
BeanDefinition student = registry.getBeanDefinition(“student”);
//获取student的propertyValues并添加age=20的属性
student.getPropertyValues().add(“age”, 20);
//创建一个通用的GenericBeanDefinition
GenericBeanDefinition genericBeanDefinition = new GenericBeanDefinition();
//设置beanClass为MyCustomizationBean1
genericBeanDefinition.setBeanClass(MyCustomizationBean1.class);
//将创建的BeanDefinition注册到registry中
最后
针对最近很多人都在面试,我这边也整理了相当多的面试专题资料,也有其他大厂的面经。希望可以帮助到大家。
下面的面试题答案都整理成文档笔记。也还整理了一些面试资料&最新2021收集的一些大厂的面试真题(都整理成文档,小部分截图)
最新整理电子书
+最新讲解视频+实战项目源码】](https://bbs.csdn.net/forums/4f45ff00ff254613a03fab5e56a57acb)收录**