1

A friend who has worked for 4 years said that he has been in touch with Spring since offline training, and it has been almost 5 years now.

Never thought, why use the Spring framework.

As a result, during the interview, I encountered such a problem.

My brain was short-circuited for a while, come to me for help, how should I answer this kind of question.

Let's take a look at the answers of ordinary people and experts

Ordinary people:

Ok. . . . . . . . . . . . .

Expert:

Spring is a lightweight application framework that provides the two core functions of IoC and AOP.

Its core purpose is to simplify the development of enterprise-level applications, so that developers only need to care about business requirements and do not need to care about Bean management.

As well as reducing code intrusiveness through aspect enhancements.

From the characteristics of Spring itself, I think several key points are the reasons why we choose the Spring framework.

  • Lightweight: Spring is lightweight, the basic version is about 2MB.
  • IOC/DI: Spring implements the management of the life cycle of beans through the IOC container, and implements dependency injection through DI, thereby realizing the loosely coupled management of object dependencies.
  • Aspect-Oriented Programming (AOP): Spring supports Aspect-Oriented Programming, which separates application business logic from system services.
  • MVC framework: Spring MVC provides more powerful and flexible web framework support
  • Transaction management: Spring implements unified management of transactions through AOP, providing very flexible support for transaction processing in application development

Finally, since the first version of Spring was released to the present, its ecology has been very large. In the field of business development, Spring ecology almost provides

image-20220411174201380

Very complete support, and more importantly, the activity of the community and the maturity of the technology are very high. The above is my understanding of this issue.

Summarize

Any technical framework must be designed to solve some specific problems, but everyone ignores this point.

Why use it? Going a little higher, it is actually technical selection, which can answer this question.

It means that you will have your own insights and thinking on solutions to business scenarios or technical problems.

So, I myself like to ask these kinds of questions during interviews.

This issue of ordinary people VS master interview series ends here.

If you have any technical interview questions that you don't understand, please feel free to private message me at any time.

file

Copyright notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated. Please indicate the source for Mic带你学架构 !
If this article is helpful to you, please help to follow and like, your persistence is the driving force for my continuous creation. Welcome to follow the WeChat public account of the same name to get more technical dry goods!

跟着Mic学架构
810 声望1.1k 粉丝

《Spring Cloud Alibaba 微服务原理与实战》、《Java并发编程深度理解及实战》作者。 咕泡教育联合创始人,12年开发架构经验,对分布式微服务、高并发领域有非常丰富的实战经验。