Chapter 3

  1. Spring stands out as the most broadly utilized Java EE framework. Spring Framework's core ideas are Dependency Injection and Aspect-Oriented Programming. Spring Framework can also be utilized in normal Java applications to accomplish free coupling between various segments by actualizing dependency injection, and we can perform cross-cutting assignments.
  1. Dependency injection configuration design enables us to expel the hardcoded dependencies and make our application approximately coupled, extendable, and viable. We can execute a dependency injection example to move the dependency goals from accumulate time to runtime. A portion of the advantages of utilizing Dependency Injection is Detachment of Concerns, Boilerplate Code decrease, Configurable segments, and simple unit testing.
  2. Aspect-oriented programming (AOP) is a programming worldview that supplements object-oriented programming (OOP) by isolating the worries of a software application to enhance modularization.
  3. Inversion of Control (IoC) is the instrument to accomplish free coupling among object dependencies. To accomplish free coupling and dynamic official of the objects at runtime, objects characterize their dependencies that are being injected by other constructing agent objects. Spring IoC container is the program that injects dependencies into an object and prepares it for our utilization.
  4. Any normal Java class that is introduced by Spring IoC container is called Spring Bean. We utilize a Spring ApplicationContext to get the Spring Bean occurrence.
  5. Much the same as MVC configuration design, a controller is the class that deals with all the customer requests and sends them to the arranged assets to deal with. In Spring MVC, org.springframework.web.servlet.DispatcherServlet is the front controller class that introduces the context-dependent on the Spring beans configurations.
  6. DispatcherServlet is the front controller in a Spring MVC application, and it stacks the Spring Bean configuration file, stating every one of the beans that are arranged. In the event that annotations are empowered, it additionally filters the bundles and designs any beans annotated with the @Component, @Controller, @Repository, or @Service annotations.
  7. ContextLoaderListener is the audience to fire up and close down Spring's root WebApplicationContext. Its important roles are to tie the life cycle of ApplicationContext to the life cycle of the ServletContext, and to robotize the production of ApplicationContext. We can utilize it to characterize shared beans that can be utilized across various Spring contexts.
  8. Boilerplate code is repetitive code that shows up again and again for similar purposes.