In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
How to achieve the introduction to Spring, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
Spring is created to solve the enterprise application development environment. One of the main advantages of the framework is the hierarchical architecture, which allows users to choose which components to use, and also provides an integrated framework for javaEE application development.
IOC and AOP are the core modules of Spring and the basis of application development of other components of other modules in the system. Only by deeply understanding the basic principles of these two modules, can we better develop Spring applications.
I. Overview of Spring
A brief introduction to a.Spring
Spring is a lightweight inversion of control (IoC) and aspect-oriented (AOP) container framework, it is mainly to solve the complexity of enterprise application development.
Objective: to solve the complexity of enterprise application development
Function: use basic JavaBean instead of EJB
Scope: any Java application
The Origin of b.Spring
Spring exists because it has unique advantages:
It locates in areas that other framework does not have.
Spring is comprehensive and modular
It is designed to help developers write code that is easy to test from the bottom.
Spring is a potential one-stop solution
Advantages of c.Spring
Spring is born with the following advantages:
Low intrusive design with extremely low code pollution
Write Once,Run Anywhere
DI effectively reduces the coupling degree.
AOP provides centralized management of common tasks
ORM and DAO simplify access to the database
Highly open and not mandatory
The benefits that Spring brings to development:
Can effectively organize middle-tier objects
Use a unified profile
Promote good programming habits and reduce programming costs
Easy to unit test
Make EJB an alternative
Provides a consistent framework for data access
Characteristics of d.Spring
Facilitate decoupling and simplify development
Support for AOP programming
Support for declarative transactions
Convenient program testing
Easy to integrate all kinds of excellent frameworks
Reduce the difficulty of using JavaEE API
The source code of Spring is a classic learning example.
The core module of e.Spring
The Spring framework is a hierarchical architecture consisting of seven well-defined modules. The module of Spring is built on top of the core container, which corresponds to the way Bean is created, configured, and managed. Each module or component that makes up the Spring framework can exist alone or in conjunction with one or more other modules to implement an application.
Core container (Spring Core)
The core container defines the basic functions of the framework. The main component of the core container is BeanFactory, which is the implementation of the factory pattern. BeanFactory uses the inversion of Control (IOC) mode to separate the application's configuration and dependency specifications from the actual application code.
Application context (Spring Context)
The Spring context is a configuration file that provides context information to the Spring framework. The Spring context includes enterprise services such as JNDI, EJB, email, internationalization, checksum and scheduling capabilities.
AOP module (Spring AOP)
Through the configuration management feature, Spring's AOP module directly integrates aspect-oriented programming functions into the Spring framework. Therefore, it is easy to make any object managed by the Spring framework to support AOP. Spring's AOP module provides transaction management services for objects in Spring-based applications. By using Spring AOP, declarative transaction management can be integrated into applications without relying on EJB components.
JDBC and DAO module (Spring DAO)
The JDBC DAO abstraction layer provides a meaningful exception hierarchy that can be used to manage exception handling and error messages thrown by different database vendors. The exception hierarchy simplifies error handling and greatly reduces the amount of exception code that needs to be written (such as opening and closing connections). Spring DAO's JDBC-oriented exceptions follow the general DAO exception hierarchy.
Object entity Mapping (Spring ORM)
The Spring framework inserts several ORM frameworks, providing a relational tool for ORM objects. These include JDO, Hibernate, and iBats. All of this follows Spring's generic transaction and DAO exception hierarchy.
Web module (Spring Web)
The Web context module is built on top of the application context module and provides context for Web-based applications. So the Spring framework supports integration with Struts. The Web module also simplifies the work of handling multi-part requests and binding request parameters to pre-objects.
MVC module (Spring Web MVC)
Spring's MVC framework is a full-featured MVC implementation for building Web applications. Through the policy interface, the MVC framework becomes highly configurable. MVC houses a number of view technologies, including JSP, Tiles, iText, and POI. The model is composed of JavaBean and stored in map. The view is an interface that implements the model. The controller represents the logic code and is the implementation of Controller.
The functionality of the Spring framework can be used in any J2EE server, and most of the features also apply to unmanaged environments. The core point of Spring is to support access objects for reusable business and data that do not use specific JavaEE services. There is no doubt that such businesses and objects can be reused between separate applications and test environments in different JavaEE environments.
After reading the above, have you mastered how to get started with Spring? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.