Still typing code mechanically? Many of us developers, when developing Spring applications, have, in many cases, passively accepted the examples of Spring features that our predecessors had made for us. This did reduce our development costs to a large extent, but it also lost a great learning opportunity and limited our developers’ ability to scale horizontally.

As a lightweight Java development framework, Spring will interface oriented programming ideas throughout the entire Java system application, so it is often mentioned in the Java interview. This article uses the proxy model and some questions in the Spring interview to talk about the important points in the Spring framework!

Why is the proxy pattern needed?

What are the advantages and bottlenecks of the static proxy pattern?

Understanding how the Java interface proxy pattern works?

How do I implement dynamic proxies using Java reflection?

Specific enhancements to the Java interface proxy pattern?

Talk about the implementation of Cglib class enhanced dynamic proxy?

What is AOP?

What is point cut, advice, Join point?

What is the difference between Join Point and Point cut?

How do I understand aspects of aspect oriented programming?

What do you understand about SpringAOP Weaving?

What is the Introduction of SpringAOP?

A simple comparison between OOP and AOP?

JDK dynamic proxy and CGLIB proxy.

Explain the implementation principle of AOP based on Schema in Spring framework.

How to implement AOP based transaction management in the Spring framework?

Spring IOC related questions

What is IOC?

Talk about your understanding of the design idea of inversion of control?

How to understand the Spring IOC container?

How many IOC containers are available in Spring?

How does Spring IOC manage dependencies between beans and avoid circular dependencies?

Understanding dependency injection for the Spring IOC container?

What are the singleton patterns and advanced features of Spring IOC?

What is the difference between a BeanFactory and a FactoryBean, and what is the difference between a BeanFactory and an ApplicationContext?

How does Spring address loop dependencies during Bean creation?

What about design patterns during Spring Bean creation?

Questions related to annotations

What kind of programming idea is annotations?

Why is it possible to directly use @AutoWired for dependency injection? How does it work?

How does Spring automatically inject Bean properties and Map/List collections via @autoWired?

How does @required check that the attributes in the XML are configured?

How does the Spring framework inject beans labeled @Component into containers?

How do @Configuration, @ComponentScan, @import, @Bean annotations work?

Using @propertysource to import a configuration file, how does the configuration file register with the Spring environment?

Explain how to implement a simple tree document generation with custom annotations.

Transaction-related issues

What does an SqlSessionFactoryBean do when configured in XML?

What does MapperScannerConfigurer do if you add it to XML?

What happens after executing the query method of the Mapper interface?

How do tx:advice/, AOP :config tags create transaction facets?

Why can annotated transactions be used when tags are added? Why Transaction rolled back was reported because it has been marked as rollback-only?

Can the Transactional annotation be applied to private or protected methods?

What are the propagation properties of transactions for, and what are nested transactions for?

Why is the transaction not rolled back when an exception is thrown?

How are Spring transactions thread-safe?

How to learn systematically and correctly

I think there are three dimensions: what problem was this framework created to solve? What is the core idea of this framework? What scenarios does this framework apply to? Speaking of thought, I think the soul of programming is thought, and programming without thought is no different than salt fish. “Don’t reinvent the wheel” sounded grand at the time, but NOW I think it can only be true in one respect.

Me, why should learn above all how to make the wheel – because you will build the wheels, using someone else’s wheels would understand the principle, and use it every time you will be handy, if you have a framework to understand just stay in, use more skilled stage, then you are a livestock “code”, someone can replace you at any time. Maybe some people will say that the project time is too tight to allow you to write a wheel, you write and those big guys write good? But WHAT I want to say is this: I didn’t say that you don’t have to write your own wheels, and your wheels don’t have to be compared to others, because the purpose of building a wheel is to understand the minds of those wheels.

Say so much actually want to tell you to learn framework to understand the underlying principles of the framework, to master is the most commonly used principles. In this I share an open source framework of the system of thinking learning tree diagram to everyone, I hope to be able to provide some help to friends in need!

In view of the above interview questions, I have summarized the answers and some architecture videos to share with you for free (including Dubbo, Redis, Netty, ZooKeeper, Spring Cloud, distributed, high concurrency and other architecture technology materials), hoping to help you review before the interview and find a good job. It also saves you time to study by searching for information on the Internet.