Dashboard > SpringSide3 Wiki > Home > Architect Convention Overview
  SpringSide3 Wiki Log In | Sign Up   View a printable version of the current page.  
  Architect Convention Overview
Added by Calvin, last edited by Calvin on 2008-10-05  (view change)
Labels: 
(None)

1.概述

   选型以工业化大规模软件开发为原则,同时照顾轻量级快速开发的需求,Java版的约定大于配置的风格渐显。

2.库栈

  • JDK:JDK 5.0/6.0、 UTF-8.
  • IOC container:Spring 2.5.
  • ORM:Hibernate 3.3.
  • Web :Struts 2.1、JSP 2.0、JQuery 1.2.
  • Web Service:Apache CXF 2.1实现的JavaEE 5 JAX-WS 2.1/JAXB2.1规范.
  • Security: Spring Security 2.0.

3.层次说明

3.1 entity - 领域模型层

    使用Sql first的开发模式,一般纯手工编写entity与极少量的JPA annotation (因为JPA向RoR学习的约定大于配置,annotation少得几不可见)

    如果遇到复杂的一对多,多对多关系,可以用IDE从数据库逆向生成。

3.2 access - 资源访问层(可选)

    资源访问层包括对数据库、JMS、外部的WebService等访问,不一定进行明确的分层。

    如Service层会直接组合使用多个SimpleHibernateTemplate<T>来访问数据库(默认拥有CRUD函数),以Service类的静态变量来定义HQL语句。

3.3 service - 业务逻辑层

    每个Service类以facade姿态负责一组业务逻辑。

    用Spring的Service annoation定义Service类,无需在xml配置文件中定义。

    用Spring的Transcation annotation定义事务。

3.4 web - Web MVC层

    MVC框架使用Struts2。用CodeBehind+ZeroConfig 实现零配置文件。

    View模板用JSP2.0 , 尽量使用纯html+JSP2.0 EL展示页面。

    Javascript不使用Dojo、ExtJS这类完全widgets方案,只用JQuery的简单封装以及JQuery Plugin控件。

3.5 ws - WebService接口

    使用Java first的开发模式,通过JSR181 annotation标注Web Service接口,用JAXB-2.0 annotation标注Java-XML Mapping。

    用DTO类实现与外系统Entity的解耦,用WebServiceResult包裹返回结果。

3.6 Security - 安全控制

     用户-角色-授权三层控制,使用Spring Security 拦截URL,使用Spirng Security的taglib 拦截页面内容。

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 2006-09-07) - Bug/feature request - Contact Administrators