== Spring Learning> getting started

First, what Spring can?

  Spring is a lightweight, non-intrusive Java / JavaEE application framework. Spring is the basic JavaBean used to do things previously only be done by EJB. However, Spring's use is not limited to the development of server-side. The vast majority of Java applications can benefit from the simplicity, testability and loose coupling from the perspective of Spring.

  The core is the Spring Inversion of Control (IoC) and the facing section (AOP). Briefly, Spring is a layered JavaSE / EE full-stack (stop) lightweight open source framework.

Two, Spring can you do?

  General said, Spring can be used as a super "glue" platform, put a lot of technology to effectively integrate together to form a whole, in order to better solve problems and make the system structure better, more superior performance. (Architecture reflects the design: modular, prefabricated, plug, reusability, non-invasive, etc.).

  Spring capable of many things, specifically, the following few basic:

  • IOC / DI
  • AOP
  • Support for JDBC and ORM of
  • Support of things
  • Integration of various technologies
  • Web application frameworks (Spring MVC)

Three, Spring What?

 

Spring can be seen from the chart contains a total of about 20 modules that make up again become: The core container module, Data Access / Integration section, Web part, AOP support part and test several parts.

The core part of the container (Core Container)

  • Beans and Core Module: provides the most basic features Spring, providing IoC and Dependency injection characteristics;
  • Context module: based on the Core and Beans to build, it provides a framework with style way to access an object, something like JNDI registry. Context encapsulated packet inherited function beans package, also increased internationalization (I18N), event propagation, resource loading, transparent and create a context;
  • Expression Language: expression language module, provides the ability to run queries and operations during object graph;

Data Access / integration portion (Data Access / Integration)

  • JDBC Module: provides the abstraction of the JDBC, which eliminates tedious JDBC coding and parsing the database vendor specific error codes;
  • ORM module: provides a common "object / relational" mapping the integration layer APIs. These include: JAP, JDO, Hibernate, Ibatis;
  • OXM modules: a support and XML Object abstract layer mapping, including JAXB, Castor, XMLBeans, JiBX, XStream;
  • JMS Module: Provides a set of "news producers, consumers" template for easier use JMS;
  • Transaction module: support for the program through a simple declarative transaction management, as long as the Spring-managed objects can benefit Spring transaction management;

Web part

  • Web module: provides basic Web functions;
  • Web-Servlet Module: provides a Web application Model-View-Controller (MVC) to achieve;
  • Web-Struts module: Provides integrated support for Struts;
  • Web-Portlet module: Provides Portlet MVC environment under implementation;

AOP part

  •  AOP module: provides a programming line with the AOP Alliance standard aspect-oriented, as can be scheduled: Method interceptors and entry points;
  • Aspects module: Provides integration of AspectJ's;
  • Instrumenttation Module: provides a number of class-level tools to support and implement ClassLoader class;

Test section

  •  Test Module: provides support for using JUnit and TestNG to test the Spring components, it provides a consistent ApplicationContexts and caches these contexts, it also provides mock objects so that you can separate test code;

Four, Spring's advantages

  • Decoupling convenient simplify the development (the high cohesion and low coupling)
    • Spring is a large plant (container), you can create all the objects and dependencies maintenance, to the Spring management;
    • spring bean plant for generating
  • AOP programming support
    • Spring provides aspect-oriented programming, you can easily implement a program permission to intercept, operation monitoring and other functions;
  • Support for declarative transactions
    • Only you need to complete the configuration management of the affairs, without manual programming;
  • To facilitate the testing program
    • Spring for Junit4 support, you can easily test program by Spring annotation;
  • Easy integration of a variety of excellent framework
    • Spring does not exclude a variety of excellent open source framework, which provides a variety of excellent internal framework: direct support (such as Struts, Hibernate, MyBatis, Quartz, etc.);
  • The difficulty of reducing the use of JavaEE API
    • Spring for some API JavaEE development is very difficult to use (JDBC, JavaMail, remote calls, etc.), provides packaging that greatly reduces the difficulty of these API application;
  • Java source code is a classic example of learning
    • Spring source exquisite design, clear structure, imaginative, always embodies the masters of the flexible use of Java design patterns and profound knowledge of Java technology. Spring Framework source code is the best practice examples of Java technology. If you want to quickly improve their Java technology and application development level in a short time, learning and research Spring source will make you receive unexpected results;

Guess you like

Origin www.cnblogs.com/L-Test/p/11593638.html