【SQL开源代码栏目提醒】:网学会员SQL开源代码为您提供Spring在SSH架构中的作用和不足 - 期刊论文参考,解决您在Spring在SSH架构中的作用和不足 - 期刊论文学习中工作中的难题,参考学习。
第23卷第1期 北京机械工业学院学报 V01.23 No.1 2008年3月 Journal of Beijing Institute of Machinery Dec.2008文章编号:1008—1658(2008)01—0054一04 Spring在SSH架构中的作用和不足 王斯琼,牟永敏 (北京信息科技大学计算机学院,北京100192) 摘 要:介绍了3个开源框架Struts,Spring和Hibernate,分析了这3个框架各自的本质、 特点以及主要的作用。
针对Spring的IoC(inversion of contr01)容器和AOP(aspect oriented program— ming)框架的特点,对Java Web开发的两种架构Struts+Hibernate和Struts+Spring+Hibernate进 行比较。
通过分析这两种框架的基本特点与
工作原理,总结在实际开发中引入Spring会带来的好 处与不足。
关键词:Spring;Struts;Hibernate;IoC;AOP 中图分类号:仰311.52 文献标识码:A Functions and defects of spring in SSH architecture WANG Si—qiong,MU Yong—min (School of Computer Science,Beijing Information Science and Technology University,Beijing 100192,China) Abstract:The open source technology of Struts,Spring and Hibernate is introduced including the nature.the characteristics and the funtion.The architecture of Struts+Hibernate and that of Struts+ Spring+Hibernate which are used in development of Java Web are discussed.And then the architecture of SH and SSH is analyzed through the inversion of control and aspect oriented programming in spring. Finally,the functions and defects of Spring in SSH architecture are presented through the developing ex— perienee. Key words:Spring;Struts;Hibernate;IoC;AOP 型中扮演中央控制器的角色。
ActionServlet主要负1开源框架 责接收HTYP请求信息,根据配置文件的配置信息,1.1 开源框架Struct 把请求转发给适当的Action对象。
Struts【l o实质上就是在JSP(java server pages) 1.2 开源框架SpringModel2的基础上实现的一个MVC(Modal View Spring心1是一个AOP框架”1和IoC容器。
运用Controler)框架。
其模型由实现业务逻辑的Jay— AOP可以创建“横切关注点”,在应用时将它们插入aBean或EJB(enterprise javabeans)组件构成,控制 代码中,使得代码有良好的可重用性。
IoC容器允器由ActionServlet和Action来实现,视图由一组JSP 许在需要生成对象的地方创建一个应用上下文,然文件构成。
后将这些对象传递给它们的合作对象。
只需要在配 视图,在Struts框架中,其实就是一组JSP文 置文件中声明对象间的关系,由IoC容器管理这些件。
它与业务逻辑相分离,并且没有模型信息,只有 对象,在需要时由Spring提供。
使用Spring,开发者标签。
这些标签可以是标准的JSP标签或客户化标 可以有效的组织中间层对象,消除项目中单例类的签。
大量使用以及对大量定制文件格式使用的需要。
无 模型表示应用程序的状态和业务逻辑。
其业务 论是使用JDBC(java data batabase connectivity)还是逻辑通常由JavaBean或EJB组件来实现。
使用ORM(read only memory),Spring都提供了一个 控制器由AetionSe