What makes the Spring framework a lightweight container?

前端 未结 5 734
说谎
说谎 2020-12-30 02:53

When people mention that Spring is a lightweight containter compared to other frameworks, do they mean? That it occupies less memory in the system or it does not have the op

5条回答
  •  礼貌的吻别
    2020-12-30 03:27

    Spring calls itself 'lightweight' because you don't need all of Spring to use part of it. For example, you can use Spring JDBC without Spring MVC.

    Spring provides various modules for different purposes; you can just inject dependencies according to your required module. That is, you don't need to download or inject all dependencies or all JARs to use a particular module.

    If you want to run a Java EE application, you can't just create a small application that will run on its own. You will need a Java EE application server to run your application, such as Glassfish, WebLogic or WebSphere. Most application servers are big and complex pieces of software, that are not trivial to install or configure.

    You don't need such a thing with Spring. You can use Spring dependency injection, for example, in any small, standalone program.

提交回复
热议问题