Dependency injection

Spring MVC is a part of the overall Spring Framework. The core feature of the Spring Framework is dependency injection (DI). Almost all other features of the Spring Framework use DI. Objects managed by the dependency injection framework are not directly instantiated in the code (using, for example, the new operator). Let's call them managed objects. These objects are created by a DI framework, such as Spring. Because these objects are created by a framework, the framework has a lot more flexibility in deciding how to set values in the object and from where to get them. For example, your Data Access Object (DAO) class might need an instance of a database connection factory object. However, instead of instantiating it in ...

Get Java EE 8 Development with Eclipse now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.