zoukankan      html  css  js  c++  java
  • JAVA系列笔记十之初识Spring

    Spring 是一个开放源代码的设计层面框架,他解决的是业务逻辑层和其他各层的松耦合的问题。

    他将面向接口的编程思想应该到整个系统,是一个轻量级的框架。比如早期的框架EJB,就是一个企业级的应用,属于重量级的框架。

    他主要优势之一是分层架构,核心是控制反转IOC和面向切面编程AOP。

    普通的三层业务框架:

     表现层:SpringMVC,Struct2

     业务层:Spring

     持久层:JDBC模板技术,SpringDataJpa,MyBatis

    比较常用的架构:SSH Struct2+Spring+Hibernate 传统企业架构

                                 SSM SpringMVC+Spring+MyBatis 互联网项目架构

                                 Spring全家桶

    Spring的特点

     1)IOC容器技术

     2)AOP切面编程,可以对权限拦截,运行监控等。

     3)声明式事务的支持,只需要通过配置就可以对事务进行管理,不需要手动写代码。

     4)方便测试。内置对Junit4的支持。

     5)方便集成。对各种开源框架提供支持。

     6)降低Java ee Api的使用难度。

       

    备注Maven仓库地址:https://mvnrepository.com/

     附上Spring的配置文件 applicationContext.xml

    <?xml version="1.0" encoding="utf-8" ?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans.xsd">
     <bean id="testService" class="cn.test.testServiceImpl">
     </bean>
    </beans>
  • 相关阅读:
    How to change hostname on SLE
    How to install starDIct on suse OS?
    python logging usage
    How to reset password for unknow root
    How to use wget ?
    How to only capute sub-matched character by grep
    How to inspect who is caller of func and who is the class of instance
    How to use groovy script on jenkins
    Vim ide for shell development
    linux高性能服务器编程 (二) --IP协议详解
  • 原文地址:https://www.cnblogs.com/junhe/p/12863414.html
Copyright © 2011-2022 走看看