The birth of springIncreasingly complex Java enterprise application development EJB's shame Lightweight development framework spring turned out
Rod Johnson "Expert one-on-one:j2ee design and Development" Coping with Application complexity, Spring's key strategy
Lightweight and minimal intrusive programming based on Pojo through injection Di and interface-oriented implementation of loose coupling based on slicing AOP and conventions for declarative programming to reduce boilerplate code through cut-and-die versions
POJOPojo definition
POJO (Plain old Java Objects) Simple ordinary Java object, a term invented by Martin Fowler, to avoid confusion with EJB and other classes or interfaces that do not inherit/implement any other Java framework are intrusive , forcing developers to write code that is hard to test with a large amount of redundancy bound to the framework
EJB2.0 Struts Spring emphasizes minimal intrusive programming based on Pojo
Spring does not force an interface that implements a specific specification or inherits a specific class spring through dependency injection to give Pojo the concept of lightweight and heavyweight frameworks in Java EE
Simple sentence: The magnitude is determined mainly by the dependence on the container, the smaller the dependencies, the lighter the container: A collection tool used to manage the behavior of components, including interactions with external environments, component lifecycles, cooperative dependencies among components, and so on in the Java Application development environment, "lightweight Java" Basically refers to two things: a simplified programming model and a more responsive container. Lightweight Java is designed to eliminate unnecessary complexity and limitations associated with traditional Java EE APIs while shortening application deployment time lightweight technology, control reversal IOC (Dependency Injection di) is critical. With IOC, developers can resolve object dependency issues without having to write complex code to execute queries, handle infrastructure exceptions, or manage connections. Another key feature that helps simplify the code, separate business logic from the infrastructure, and make it easier for applications to maintain lightweight Java is that it does not force business objects to follow platform-specific interfaces. This sequential developer implements business logic in ordinary Java objects (POJO) to increase productivity
Dependency InjectionThe idea of "overly" complex software system components: separating focus Dependency Injection: forcing components to be built and used decoupling has two sides
Coupling code difficult to test some degree of coupling inevitably relies on injecting di-dependency injection benefits: Loosely coupled spring assembles them by using the context load bean definition, and the application context is responsible for creating and assembling the object
Apply SliceCrosscutting concerns
eliminate boilerplate code with templates
Application ContextIn spring applications, objects live in the spring container, which is the core spring container of the spring framework:
The Bean Factory Application Context application context is built based on the Bean factory and provides application-oriented services spring common application contexts:
Classpathxmlapplicationcontext Filesystemxmlapplicationcontext Xmlwebapplicationcontext
the life cycle of a bean
Spring ModuleGet the Spring Publishing package
Spring Download Community: SpringSource Self-built download Community www.springsource.com/download/community Maven Center: The repository for MAVEN tools default Access Enterprise Module Warehouse: An enterprise module warehouse maintained by SpringSource, similar to maven Maven's father-in-law repository: located in Amazon S3 server
The spring release package no longer comes with an example project to download the core spring container from Https://annosvn.springframework.org/svn/spring-samples via the SVN client tool
Core containers responsible for the creation of beans in spring applications, and managing bean factories-Providing dependency injection application contexts-provides different ways to configure spring the module also offers many Enterprise services: Mail, Jndi access, EJB integration, scheduling spring's AOP modules
is the foundation of the Spring Application Development Section AOP helps with object decoupling AOP can decouple application-wide concerns from applied objects data access and integration
Spring's JDBC and DAO modules encapsulate the boilerplate code for database access, making the code concise and effective in managing the exception Spring's ORM module resumes on DAO support and provides an easy way to build DAO for some ORM frameworks Spring's integration module for some popular ORM frameworks also includes the spring abstraction layer built on top of JMS, using messages asynchronously with other application integration modules and using AOP to provide things management services Web and remote calls for objects in spring applications
The spring MVC Spring Remote Invocation service integrates RMI, Hessian, Burlap, JAW-WS, and a remote call framework: HTTP invoker Test-Test module Test Spring applicationSpring PortfolioThe entire spring portfolio provides spring programming model for almost every area of Java Development Spring Web Flow Spring web Service Spring Security Spring intergration Spring Batch Spring Social Spring Mobile spring Dynamic Modules Spring Rich Client