美文网首页
Spring框架概述

Spring框架概述

作者: 杰伦哎呦哎呦 | 来源:发表于2019-03-25 10:57 被阅读0次


    spring框架概述

    什么是spring

    [if !supportLists]l  [endif]Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java 开发框架,由Rod Johnson 在其著作Expert One-On-One J2EE

    Development and Design中阐述的部分理念和原型衍生而来。它是为了解决企业应用开发的复杂性而创建的。框架的主要优势之一就是其分层架构,分层架构允许使用者选择使用哪一个组件,同时为 J2EE 应用程序开发提供集成的框架。Spring使用基本的JavaBean来完成以前只可能由EJB完成的事情。然而,Spring的用途不仅限于服务器端的开发。从简单性、可测试性和松耦合的角度而言,任何Java应用都可以从Spring中受益。Spring的核心是控制反转(IoC)和面向切面(AOP)。简单来说,Spring是一个分层的JavaSE/EE full-stack(一站式) 轻量级开源框架。

    [if !supportLists]l  [endif]轻量级:与EJB对比,依赖资源少,销毁的资源少。

    [if !supportLists]l  [endif]分层:一站式,每一个层都提供的解决方案

           web层:struts,spring-MVC

           service层:spring

           dao层:hibernate,mybatis ,jdbcTemplate  --> spring-data

    [if !supportLists]l  [endif]方便解耦,简化开发  (高内聚低耦合)

    [if !supportLists]•    [endif]Spring就是一个大工厂(容器),可以将所有对象创建和依赖关系维护,交给Spring管理

    [if !supportLists]•    [endif]spring工厂是用于生成bean

    [if !supportLists]l  [endif]AOP编程的支持

    [if !supportLists]•    [endif]Spring提供面向切面编程,可以方便的实现对程序进行权限拦截、运行监控等功能

    [if !supportLists]l  [endif]声明式事务的支持

    [if !supportLists]•    [endif]只需要通过配置就可以完成对事务的管理,而无需手动编程

    [if !supportLists]l  [endif]方便程序的测试

    [if !supportLists]•    [endif]Spring对Junit4支持,可以通过注解方便的测试Spring程序

    [if !supportLists]l  [endif]方便集成各种优秀框架

    [if !supportLists]•    [endif]Spring不排斥各种优秀的开源框架,其内部提供了对各种优秀框架(如:Struts、Hibernate、MyBatis、Quartz等)的直接支持

    [if !supportLists]l  [endif]降低JavaEE API的使用难度

    [if !supportLists]•    [endif]Spring 对JavaEE开发中非常难用的一些API(JDBC、JavaMail、远程调用等),都提供了封装,使这些API应用难度大大降低

    相关文章

      网友评论

          本文标题:Spring框架概述

          本文链接:https://www.haomeiwen.com/subject/wqcvvqtx.html