parent
e5e43de98a
commit
ce27cd1633
48 changed files with 73 additions and 169 deletions
@ -1,20 +1,8 @@ |
||||
# Terminology |
||||
|
||||
Spring Core is the foundation of the Spring Framework, which provides a comprehensive programming and configuration model for Java-based applications. Here are some key terms and concepts related to Spring Core: |
||||
Spring Core, the base of the Spring Framework, provides a model for configuring Java applications. Key concepts include **Beans** (Java objects managed by Spring), **Inversion of Control (IoC)** (Spring managing bean lifecycles and dependencies), and **Dependency Injection (DI)** (Spring providing bean dependencies). The **Spring container** (specifically an **ApplicationContext**) creates and manages these beans. Spring also offers **Aspect-Oriented Programming (AOP)** for handling cross-cutting concerns, an **event model** for decoupled communication using **ApplicationEvent** and **listeners**, abstractions for **Data Access** and **Transactions**, and utilities for **Task Execution and Scheduling**. |
||||
|
||||
- Beans: In Spring, a "bean" is a Java object that is managed by the Spring container. Beans are typically defined using configuration metadata, which can be specified in XML, Java annotations, or Java code. |
||||
- Inversion of Control (IoC): One of the main principles of Spring is Inversion of Control (IoC), which means that the Spring container is responsible for managing the lifecycle of beans and injecting their dependencies. |
||||
- Dependency Injection (DI): Spring uses Dependency Injection (DI) to manage the dependencies between beans. In DI, an object's dependencies are provided to it by the container, rather than the object creating or looking up its own dependencies. |
||||
- Container: The Spring container is the core part of the Spring Framework, which creates and manages beans and their dependencies. |
||||
- ApplicationContext: An ApplicationContext is an implementation of the Spring container. It is responsible for loading and managing the configuration metadata and creating the beans defined in that metadata. |
||||
- Aspect-Oriented Programming (AOP): Spring supports Aspect-Oriented Programming (AOP), which allows you to separate cross-cutting concerns, such as logging or security, from the business logic of your application. |
||||
- Events: Spring provides an event model that allows beans to send and receive events. This is used to decouple the beans from each other, making the application more loosely coupled. |
||||
- ApplicationEvent and listener: Spring support publish subscribe model for event handling, ApplicationEvent defines event object, and the listener is a class that implements ApplicationListener interface, listening for the specific event and take the necessary action. |
||||
- Data Access: Spring provides a consistent, high-level abstraction for data access using various frameworks like JDBC, Hibernate, JPA. |
||||
- Transactions: Spring provides a flexible, consistent and easy way to declaratively manage transactions with different underlying technologies such as JPA, JDBC, and Hibernate. |
||||
- Task Execution and Scheduling: Spring provides a TaskExecutor and TaskScheduler, providing a convenient way to run tasks concurrently, on a scheduled basis or asynchronously. |
||||
Visit the following resources to learn more: |
||||
|
||||
This list is not exhaustive, it covers common terms and concepts used. Visit the following links to learn more about Spring: |
||||
|
||||
- [@official@Spring Boot - Official Website](https://spring.io/projects/spring-boot) |
||||
- [@official@Spring Boot](https://spring.io/projects/spring-boot) |
||||
- [@official@Spring Boot - Starter Guide](https://spring.io/quickstart) |
||||
|
@ -1,14 +1,9 @@ |
||||
# Components |
||||
|
||||
The Spring MVC (Model-View-Controller) framework has several key components that work together to handle the requests and generate the appropriate responses in a web application. These components include: |
||||
|
||||
- `DispatcherServlet`: This is the front controller of the Spring MVC architecture. It is responsible for handling incoming requests, delegating responsibility to other components, and ultimately returning a response to the user. |
||||
- `Controller`: Controllers handle the incoming requests, perform any necessary business logic on the Model, and then forward or redirect the request to the appropriate view. |
||||
- `Model`: The Model represents the data and the business logic of the application. It can be implemented using JavaBeans, POJOs, or other Java objects. |
||||
- `View`: The View is responsible for generating the HTML that is sent to the client's web browser. In Spring MVC, views are typically implemented using JSPs, but other view technologies such as Thymeleaf, FreeMarker, Velocity can also be used. |
||||
- `ViewResolver`: This is responsible for resolving views based on the request and configured view resolvers. It maps logical view names to actual views, such as JSPs or Thymeleaf templates. |
||||
- `Form Controllers`: These are special type of controllers that handle form submissions, and are responsible for data binding, validation and error handling. |
||||
- `HandlerMapping`: This maps requests to appropriate controllers, responsible for handling the requests. |
||||
- `HandlerAdapter`: This is used to handle the request and generate the response. |
||||
|
||||
There are other supporting components that are used to manage the lifecycle of the application's objects, such as the Spring IoC container and different interceptors that provides additional functionality, such as caching and security. |
||||
The Spring MVC (Model-View-Controller) framework has several key components that work together to handle the requests and generate the appropriate responses in a web application. |
||||
|
||||
There are other supporting components that are used to manage the lifecycle of the application's objects, such as the Spring IoC container and different interceptors that provides additional functionality, such as caching and security. |
||||
|
||||
Visit the following resources to learn more: |
||||
|
||||
- [@official@Web MVC Framework](https://docs.spring.io/spring-framework/docs/3.2.x/spring-framework-reference/html/mvc.html) |
Loading…
Reference in new issue