java框架-----spring框架------spring概述

 

1.spring框架(概述)

 

  1. 構成spring框架的全部模塊
    • The Spring Framework consists of features organized into about 20 modules. These modules are grouped into Core Container, Data Access/Integration, Web, AOP (Aspect Oriented Programming), Instrumentation, Messaging, and Test, as shown in the following diagram.  
    • All avaible features and modules are described in the Modules section of the reference documentationhtml

    • 在spring開發包中,上圖所示各個模塊被分開打包成「spring-模塊名稱-版本號.RELEASE.jar」,(e.g. spring-core-4.3.4.RELEASE.jarspring-webmvc-4.3.4.RELEASE.jarspring-jms-4.3.4.RELEASE.jar, etc.). 實際工程中,並不須要將spring的全部模塊都包含進你的工程,你能夠根據實際須要只選擇你的工程可以用到的那幾個模塊對應的jar包添加至你的工程中就能夠了。
    • 另外,spring框架的全部jar包以及spring框架所依賴的其餘jar包均可以在maven的中央倉庫找到,因此若是你的工程是使用maven進行管理的,那麼你的工程中引入spring時將會變得很是便捷:由於maven會自動從maven的中央倉庫下載你的項目所依賴的spring的jar包以及spring所依賴的其餘jar包到maven local repository中,
  2. 如何使用spring

      step1,明確spring是支持maven的web

          Each release of the Spring Framework will publish artifacts to the following places:spring

          • Maven Central, which is the default repository that Maven queries, and does not require any special configuration to use. Many of the common libraries that Spring depends on also are available from Maven Central and a large section of the Spring community uses Maven for dependency management, so this is convenient for them. The names of the jars here are in the form spring-*-<version>.jar and the Maven groupId is org.springframework.
          • ArtifactId見下表
          • GroupId ArtifactId Description

            org.springframeworkexpress

            spring-aopbootstrap

            Proxy-based AOP supporttomcat

            org.springframeworkwebsocket

            spring-aspectsmvc

            AspectJ based aspectsapp

            org.springframework框架

            spring-beans

            Beans support, including Groovy

            org.springframework

            spring-context

            Application context runtime, including scheduling and remoting abstractions

            org.springframework

            spring-context-support

            Support classes for integrating common third-party libraries into a Spring application context

            org.springframework

            spring-core

            Core utilities, used by many other Spring modules

            org.springframework

            spring-expression

            Spring Expression Language (SpEL)

            org.springframework

            spring-instrument

            Instrumentation agent for JVM bootstrapping

            org.springframework

            spring-instrument-tomcat

            Instrumentation agent for Tomcat

            org.springframework

            spring-jdbc

            JDBC support package, including DataSource setup and JDBC access support

            org.springframework

            spring-jms

            JMS support package, including helper classes to send and receive JMS messages

            org.springframework

            spring-messaging

            Support for messaging architectures and protocols

            org.springframework

            spring-orm

            Object/Relational Mapping, including JPA and Hibernate support

            org.springframework

            spring-oxm

            Object/XML Mapping

            org.springframework

            spring-test

            Support for unit testing and integration testing Spring components

            org.springframework

            spring-tx

            Transaction infrastructure, including DAO support and JCA integration

            org.springframework

            spring-web

            Web support packages, including client and web remoting

            org.springframework

            spring-webmvc

            REST Web Services and model-view-controller implementation for web applications

            org.springframework

            spring-webmvc-portlet

            MVC implementation to be used in a Portlet environment

            org.springframework

            spring-websocket

            WebSocket and SockJS implementations, including STOMP support

          • 若是你決定使用maven管理你的軟件工程,那麼如何使用maven爲你的項目自動添加spring框架的相關jar包呢?詳細教程參見以下連接:使用maven爲個人項目添加spring相關jar包
          • So the first thing you need to decide is how to manage your dependencies: we generally recommend the use of an automated system like Maven, Gradle or Ivy, but you can also do it manually by downloading all the jars yourself.
相關文章
相關標籤/搜索