1.3 Spring view of the world into spring

Source: Internet
Author: User
Tags sql error

1.3 Views of Spring

Spring's beginner's mind is through dependency injection, Simplify Java enterprise-level development by targeting facets and reducing template code. Reasonable use of spring can reduce Java development, but the spring framework is now a large ecosystem (after all, spring is the Java against Java is a big platform Today's spring has evolved into a technology platform, with core-based frameworks that extend to technologies such as web-service,rest, mobile devices, and NoSQL.

Take a look at the core framework to see what spring brings, and learn about the other members of the spring briefcase.

1.3.1 Spring Module This part is purely a concept.

Download Spring and open the Lib directory, you can see a lot of jar files. There are 20 different small modules in the Spring4.0.

These modules can be divided into 6 functional strategies, from which the most information about Java Enterprise Development can be given. But we can choose a few of these feature strategies to meet our own applications. If spring does not meet our needs, we can look for other frameworks to meet our applications. And spring provides many connection points that are integrated with other frameworks.

Spring Core Container

The heart of the spring framework is a container for managing the creation, configuration, and management of beans in spring. The component that provides DI in this module is springbeanfactory. Based on Springbeanfactory, there are several implementations of spring ApplicationContext that provide different ways to configure spring (previously mentioned).

In addition, Bean factory and application context also provide many enterprise services, such as EMAIL,JNDI,EJB integration and scheduling.

All of these modules are based on the core container. We may use these classes when we configure the application. The second chapter will delve into spring's di.

Spring AOP Module

Sping provides great support for aspect-oriented programming. This module can be used as a basis for slicing programming. Like Di, AOP implements loose coupling of applied objects. With APO, some of the entire application's concerns are decoupled from the objects they apply to. The fourth chapter will talk about AOP.

Data access and integration

using JDBC normally produces many template code. Spring abstracts These template code so that the code we write is clearer and simpler, and prevents some problems with shutting down database resources. This module also establishes a meaningful exception level based on the exception messages generated by various databases. There is no need to try to decipher the mysterious and exclusive SQL error messages.

For those who prefer to use object-relational mapping (ORM), Spring provides an ORM module. Spring's support for ORM is based on the support of DAO, providing a convenient way to build DAO for several ORM solutions. Instead of trying to implement its own ORM solution, Spring provides hooks to integrate with the popular framework, such as Hibernate,jpa,java Data Object,ibatis SQL Maps.spring's transaction management supports each ORM framework, including JDBC.

We can see that the JDBC-based spring template can greatly simplify JDBC when we use data access in the tenth chapter.

This module also includes a Java message service-based abstraction for asynchronous integration with other applications through messages. And starting with Spring3.0, this module includes a mapping function for XML files, which was initially part of the Spring Web Service project.

In addition, this module uses spring's AOP module to provide transaction management services for objects in spring applications.

Web and Remote

MVC Design is a very broad approach for Web applications that separates user interfaces from implementation logic. Java does not lack the implementation of the MVC framework, such as Struts,jsf,webwork,tapestry (a popular MVC choice).

Even if spring can be integrated with a working MVC framework, there is an MVC framework available in Web and remote modules that is loosely coupled in Web applications. Will learn the spring MVC framework in the 第5-7 chapter

to satisfy user-facing Web applications, this module also provides several remote options to enable an application to interact with several applications. This module includes RMI (Remote Method invoke), Hessian,bur-lap,jax-ws, and Spring's own HTTP caller. Spring also provides an API that supports restful styles. In the 15th chapter, we will learn spring remote and touch the rest API in Chapter 16.

Tools

Spring's tooling module includes support for adding proxies to the JVM. Specifically, the weaving proxy is provided for Tomcat, which can change the class file when the class loads.

This module is rarely introduced in this book, or is seldom used, or the people who can use it well are generally Daniel. So let's just be a calf.

Test

Recognizing the importance of testing, Spring provides a module dedicated to helping with testing.

In this module, you will see a number of mock objects used to write unit tests, using jndi,servlets,portlets. For integration level testing, this module provides load support for beans in spring application context.

Through this book, many examples will be tested using this module.

1.3 Spring view of the world into spring

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.