您好,欢迎来到华佗养生网。
搜索
您的当前位置:首页基于Java的网上购物系统的设计和实现附录

基于Java的网上购物系统的设计和实现附录

来源:华佗养生网


北京信息科技大学

毕业设计(论文)附录

题目: 基于Java的网上购物系统的设计和实现

学院: 自动化学院 专业: 自动化

学生姓名:陈爽 班级/学号:J自控0701/2007010660

指导老师/督导老师: 王巧玲 / 袁德全

起止时间: 2011年 2月21日至 2011年 6月17日

目录

目 录

一、综述 .......................................................................................................................................... 1 二、研究内容 .................................................................................................................................. 2 三、实现方案及目标 ...................................................................................................................... 2 四、对进度的具体安排................................................................................................................... 4 五、参考文献 .................................................................................................................................. 4 附录2 程序 ................................................................................................................................... 1 附录3 外文文献译文 ................................................................................................................... 1

附录1 开题报告

附录1 开题报告

基于java的网上购物系统的设计和实现

开题报告

班级(学号): J自控0701班 (2007010660) 姓名:陈爽

指导教师:王巧玲 袁德全

一、综述

在欧美等信息化程度较高的国家和地区,网络购物发展的非常迅猛,美国的很多零售商,如沃尔玛、家庭仓储等纷纷跻身于网络经商的行列。调查表明:美国的家庭已经越来越习惯于在家中从网上购物。

未来几年之内购物市场的用户数量将会进一步增长。各项环境的改善,使网络购物的优势进一步凸现,交易额也将有较大的提高。随着进入者的增多,竞争将更加剧烈,主要表现为资金的大量投入以及竞争方式的多样化,竞争将产生两方面的结果:一方面,一些购物网站逐步完善自身的管理和服务,为用户提供良好的交易环境,积累了庞大的顾客基础,形成明显的网络经济效应;而一些规模较小的网站则不堪重负,逐渐退出市场。另一方面,市场的竞争吸引了各界的极大关注,培育了人们网上交易的习惯,加深参与度,给网络购物市场带来繁荣。

随着网络环境的不断改善和网民的不断增加,会有越来越多的传统企业开展网络购物服务,网络购物市场会越来越大,其潜在的经济效益也无疑是巨大的。作为电子商务的一部分,它的春

1

附录1 开题报告

天已经随着互联网的快速发展而到来,并呈现了良好的发展势头。

随着中国市场经济的日趋成熟,中国企业面对的竞争压力也越来越大,企业要想生存,就必须充分利用信息化手段来提高管理效率及市场响应速度。网上商城是在互联网开放的网络环境下,基于浏览器/服务器应用方式,实现消费者的网上购物、商户之间的网上交易和在线电子支付的一种新型的商业运营模式。网上商城做为一种的经济形态,已初具规模,一些网上商城网站的成立,给人们的生活带来了巨大的影响。

从国内外的发展动态来看基于JSP技术的网上购物系统,能够有效地将产品管理系统和网上订购系统有效地结合在一起,通过网站实现企业的在线交易来销售自己的产品,进一步扩大市场份额。通过产品订购管理系统的网上交易,企业可以随时随地了解和掌握销售情况,实现产品销售统计分析同时又能有效地控制商场运营成本,开辟了一个新的销售渠道。

二、研究内容

本系统是用JSP在网络上架构一个动态的电子商务网站,它是在Windows XP下,以Oracle为数据库开发平台,Tomcat网络信息服务作为应用服务器,采用JSP(Java Server Pages)技术开发的网上购物系统。其主要包括:购物网站应用系统的开发与设计、购物网站动态数据库的规划设计与建设、购物网站的网页规划设计与制作。

三、实现方案及目标

1.系统设计方案:

(1)首先要对网上购物系统做一个整体的需求分析。

2

附录1 开题报告

其中,前台部分由用户使用,主要包括用户注册,购物车管理,订单管理,个人资料管理,个人资料的加密技术。此处的前台界面主要使用jsp和javascript技术实现,加密主要采用MD5加密技术实现;后台部分由管理员使用,主要包括管理员身份验证,商品管理,处理订单,用户信息管理,连接信息管理等。

(2)系统功能模块的设计

前台部分由用户使用,主要包括用户注册,生成订单,购物车管理,查看购物车,查看留言,订购产品,订单查询和用户信息加密7个模块;后台部分由管理员使用,主要包括管理员身份验证,商品管理,处理订单,用户信息管理,连接信息管理5个模块。每个模块都采用了java中的ssh整合技术,将个模块组合起来。

(3)数据库需求分析

整个系统功能需要用户、商品、订单、管理员这四个数据项。用户包括用户id、用户名称、登录密码、用户真实姓名、性别、邮箱地址、联系地址、联系电话、密码问题、注册时间,商品包括商品id、名称、价格、图片路径、类型、简要介绍、存储地址、发布时间、是否推荐。管理员包括管理员id、管理员名称、管理员密码。

在此处主要是建立实体之间的对应关系,利用hibernate技术将数据存储到数据库中对数据进行持久化的保存。

(4)整体功能的测试及调优。

2.本设计需要解决的主要问题及难点:

3

附录1 开题报告

(1)要实现顾客可以方便的通过本购物系统查询并订购商品;

(2)要设计出一个美观,友好的前台界面展示给用户;

(3)系统应选用功能强大的数据库保存各类信息;

(4)要实现商家可以方便的任意定义各种商品信息;

(5)用户无需考虑系统的安装维护即要求实现一个安全的网上购物系统。

四、对进度的具体安排

1-2周:文献综述及撰写开题报告。

3-8周:编写各java实体类,确定各实体间关系,创建与实体相关的表

9-12周:实现数据库对数据的增删改查一些逻辑业务。

13-16周:编写前台网页并利用ssh技术将数据库和网页整合使网页正常使用,最后对完成的系统总体功能实现。论文书写课题总结答辩。

五、参考文献

[1]陈火旺,徐建波, 周新莲. Web设计原理与编程技术[M]. 中南大学出版社. 2008:81-86

[2]武延军,黄飞跃. 精通JSP编程技术[M]. 人民邮电出版社. 2007:10-13

4

附录1 开题报告

[3]徐国智, SQL 数据库系统开发实例精粹, 电子工业出版社,2006:25-27

[4]飞思科技产品研发中心. JSP应用开发详解[M]. 电子工业出版. 2005:26-31

[5]柏亚军. JSP编程基础及应用实例集锦[M]. 人民邮电出版社. 2007:-67

[6](美)Michael J.Young, XML学习指南[M]. 机械工业出版社. 2004:58-67

[7]李江,张威. 实例解析XML/XSL/Java网络编程[M] 北京希望电子出版社 2009:35-39

[8]塞奎春. JSP信息系统开发实例精选[M]. 机械工业出版社. 2006:69-82

[9](美)Damon Hougland, Aaron Tavistock , JSP 核心技术[M]. 机械工业出版社. 2007:35-45.

[10](美) Craig Walls,Ryan Breidenbach等著, 李磊、程立、 周悦虹译, Spring In Action,人民邮电出版社,2006年3月:25-56

[11](美) Christian Bauer , Gavin King等著, Hibernate In Action,Manning Publications,2006年04月11日:25-34

[12]徐小龙,王汝传,邓玉龙. 用MD5技术构建高安全性电子商务系统[J]. 南京邮电学院学报,2002-04:21-35

[13]柏银,李志蜀,朱兴东. MD5算法及其在远程身份认证中的应用[J]. 四川大学学报(自然科学版),2006-02:12-15

5

附录1 开题报告

[14]杨一冰. 基于ORM的Hibernate持久层框架[J]. 电脑编程技巧与维护,2010-04:5-11

[15]赵强,蒋念平. 基于Struts框架的研究生教学管理系统的设计与实现[J]. 电脑学习,2010-01:15-21

[16]孟小华,安现波,李展. Struts和Hibernate在移动卡类业务系统中的应用[J]. 计算机工程与设计,2010-02:12-18

[17]樊建文,李宁. J2EE平台架构上开发CRM的技术过程控制[J]. 福建电脑,2010-01:15-19

[18]敬晓芳. 解析Eclipse和各插件的关系[J]. 电脑编程技巧与维护,2010-02:21-23

[19]刘芳,虢红霞,齐泉. 基于SSH整合框架的E-HR系统应用研究[J]. 武汉理工大学学报,2009-03:21-25

指导教师:(签署意见并签字) 年 月 日

督导教师:(签署意见并签字) 年 月 日

领导小组审查意见:

审查人签字: 年 月 日

6

附录2 程序

附录2 程序

1

附录3 外文文献译文

附录3 外文文献译文

定义制定方法基于Web的J2EE信息系统

1 介绍

软件工具和复杂的空间动态系统的非线性分析软件包越来越多使用网络为他们的用户界面,实现科学分析的基础网络平台分布仿真结果,科学家之间的信息交流。实时的基于Web的访问非线性分析模拟软件成为许多应用系统的重要组成部分。密集的技术变革中的网络硬件和软件提供更多的选择比过去自由。Web开发现阶段的特点是开源框架的大量出现。框架转向网络发展的重点向更高层次,使基本的功能,从而重用提高发展生产力。框架转向网络发展的更高层次,允许基本功能的再次使用,从而提高了开发效率。在某些情况下,开源框架没有提供一个解决共同的问题。基于这个原因,开发员建立他们在开源的框架上自己的发展框架。目前常见的应用程序设计,往往是整个项目中使用的关注。

2 所开发的架构,主要技术

2.1 层和分离的代码和配置

Web应用程序,如介绍各种设计问题,业务逻辑,数据存取和安全性。分离进入不同的代码层的设计要求具有几个优点:易于维修,能够实现良好的设计模式,能够选择的专业工具和技术的具体问题。分离项目成层可以导致这些层之间的依赖关系。例如,单用例涉及简单的数据输入和调查通常要结合介绍,业务逻辑和数据访问,共同提供必需的功能。因此,必须有一个明确的战略来管理依赖关系。所开发的某某框架结合设计模式,可重复使用的代码和配置文件,以使尽可能这个容易。这个框架使用Spring的控制反转来管理依赖关系。Spring框架提供了一种方法,

1

附录3 外文文献译文

以配合在一起的对象构成申请。它完成这与Spring应用上下文,这是一个战略目标管理对象之间的依赖关系。依赖注入和Spring使用下面介绍的方法拦截技术。我们写的代码是取决于它使用的对象。它是用于创建这些对象负责。这可能会导致在紧耦合的,但我们希望,我们的代码是松散耦合的。依赖注入是一种技术,它可以帮助我们能够做到这一点。依赖注入是一个控制(IOC)反转形式。当应用程序使用的依赖注塑,代码变得更清洁,更容易执行。它也是松散耦合,更容易配置,使和测试。某某的框架使用的Spring应用上下文几个文件来定义层之间的依赖关系。方法拦截是一种面向方面编程(AOP)的概念。 Spring AOP的实现方法拦截通过JDK的动态代理。在某某框架使用Spring AOP的管理问题,如事务管理和性能监测。

所开发的某某框架包括:两个不同的部分代码和配置。居住在一个特定的代码应用层和应用程序的一个解决方案,特别是一块重点。这可能是与数据库交互,或提交数据到屏幕上。配置将应用程序的各层连接在一起。分离配置从代码可以让我们来管理配置,使我们有不同的配置,应用灵活性相同的代码基础。例如,一个数据访问对象(DAO)实现知道它是使用JDBC连接至通过数据库的数据源,但它不知道该数据源实现任何事情。它可能会从Java命名和目录接口(JNDI)的范围内或从驱动程序管理器导出。它可能指向远程数据库或本地数据库。无论在何地从数据源,DAO实现来运作的数据源以相同的方式。同样,一个服务对象可能取决于DAO的,但不知道是否DAO是通过Hibernate的实施,直接的JDBC或Web服务。Spring给了我们一个方法来管理,通过一个Spring应用上下文的应用程序的整个配置,定义为一个XML文件集。我们可以在一个文件中定义应用程序的上下文。然而,在较小的文件定义,团体使我们可以简化配置管理。以这样的应用程序上下文文件,构成一套完整的应用程序的逻辑配置被称为配置。

Spring通过在XML文件中定义的Spring应用上下文来管理应用程序的整个配置。我们可以在一个文件中定义应用程序的上下文。然而,在较小的文件定义中,我们可以简化配置管理。在基于Java的企业级应用开发中标准配置文件是一个使用了外部资源,例如数据源和JNDI源的框架配置文件。这种类型的配置文件会产生一些问题:(1)还没有被加载的不完整的数据库。开发

2

附录3 外文文献译文

人员可能希望测试某些类型的数据显示,但是如果基础数据库尚未完成,他们将无法做到这一点。(2)业务层和DAO层可能还没没有被开发出来。这些问题将降低生产率。所开发的某某框架使它的配置从代码中分离出来。我们可以使用备用配置专门设置实现发展目标。这将缓解我们外部系统可用性的困扰,这样可以解决当前发展的需要。所开发的某某框架定义了两个配置文件:默认的和的。我们还可以根据我们的项目需求在原有的配置文件上添加额外的配置。所开发的某某框架通过它的应用上下文来进行配置。应用程序上下文中可以定义一个或更多的XML文件。一个配置集是一系列的XML文件定义一个应用程序上下文。配置集由两部分组成:业务层和网络层。

2.2 类和依赖关系

利用所开发某某框架,下面的代码和配置文物将通常需要发展用户界面屏幕:(1)行动的ActionForm类和validation.xml项;(二)服务接口和实现类;(三)DAO接口和实现类;(四)依赖之间的上述所有管理。当启动一个用例的发展,我们必须意识到,所有这些类的需要和它们的依赖预付款项。

2.3 测试技术

测试应是发展进程的组成部分。为建立使用发达某某框架的应用,单元测试是指测试中的一个集成层的服务或单一类的方法。为了执行不同类型的测试,正在开发的应用程序必须是可检验的。让我们列出了一些一个可测试的应用程序的基本特征。 (1)发展中国家的单元和集成测试轻松。我们应该能单位测试而不必使用数据源,或队列。此外,我们应该能够依赖的代码模拟测试下。 (2)易用性,功能测试各种模拟测试场景。 (3)重新运行多次在生命周期的所有测试轻松应用程序。 (4)测试应用程序代码中的代码情节分离。

3

附录3 外文文献译文

2.4 Web演示文稿设计

所开发的某某框架使用了Struts框架的概念和JavaScript来实现演示文稿的关注并规定可为projects.当使用Struts框架开发时,首先我们在web.xml中设置Servlet的行动,然后在struts - config.xml中我们成立了配置,actionmappings,formbeans和local forwards,最后我们成立了validation.xml验证规则。有两种类型所需要的验证:数据格式验证和业务逻辑验证。数据格式验证最好做表示层,而业务逻辑验证是最好的服务层完成。业务逻辑的验证错误,这在服务层发生,应通过抛出自定义异常处理。

2.5 数据库访问

与发达某某框架支持直接使用JDBC和Hibernate框架构建的应用程序来坚持在发送数据到关系数据库。应用程序配置了必要的Spring上下文文件。 DAO的是直接使用JDBC必须扩大从Spring框架的JdbcDaoSupport.java类。同样,使用Hibernate必须的DAO从扩展Spring框架的HibernateDaoSupport.java类。

2.6 通过注解配置

所开发的某某框架使用Spring框架,以保持双方的代码依赖于工件申请。这些行动和ActionForm之间的依存关系被配置在\"struts - config.xml\"中,而有些(如与服务和DAO)被配置在Spring应用程序上下文文件\"applicationContext.xml\"中。在一个团队环境中的这些配置文件是共同的发展。这就是为什么在这些配置版本冲突文件可能发生。所开发的某某框架提供了新的有效的方法是使用特殊的注释来指定所有这些依赖关系。通过使用这些批注,配置变得简单,并配置冲突的更改文物是可以避免的。

4

附录3 外文文献译文

3 J2EE的优势

3.1保留现存的IT资产:

由于企业必须适应新的商业需求,利用已有的企业信息系统方面的投资,而不是重新制定全盘方案就变得很重要。这样,一个以渐进的(而不是激进的,全盘否定的)方式建立在已有系统之上的服务器端平台机制是公司所需求的。J2EE架构可以充分利用用户原有的投资,如一些公司使用的BEA Tuxedo、IBM CICS, IBM Encina,、Inprise VisiBroker 以及Netscape Application Server。这之所以成为可能是因为J2EE拥有广泛的业界支持和一些重要的'企业计算'领域供应商的参与。每一个供应商都对现有的客户提供了不用废弃已有投资,进入可移植的J2EE领域的升级途径。由于基于J2EE平台的产品几乎能够在任何操作系统和硬件配置上运行,现有的操作系统和硬件也能被保留使用。

3.2高效的开发:

J2EE允许公司把一些通用的、很繁琐的服务端任务交给中间供应商去完成。这样开发人员可以集中精力在如何创建商业逻辑上,相应地缩短了开发时间。高级中间件供应商提供以下这些复杂的中间件服务: o 状态管理服务 -- 让开发人员写更少的代码,不用关心如何管理状态,这样能够更快地完成程序开发。 o 持续性服务 -- 让开发人员不用对数据访问逻辑进行编码就能编写应用程序,能生成更轻巧,与数据库无关的应用程序,这种应用程序更易于开发与维护。 o 分布式共享数据对象CACHE服务 -- 让开发人员编制高性能的系统,极大提高整体部署的伸缩性。

3.3支持异构环境:

J2EE能够开发部署在异构环境中的可移植程序。基于J2EE的应用程序不依赖任何特定操作

5

附录3 外文文献译文

系统、中间件、硬件。因此设计合理的基于J2EE的程序只需开发一次就可部署到各种平台。这在典型的异构企业计算环境中是十分关键的。J2EE标准也允许客户订购与J2EE兼容的第三方的现成的组件,把他们部署到异构环境中,节省了由自己制订整个方案所需的费用。

3.4 可伸缩性:

企业必须要选择一种服务器端平台,这种平台应能提供极佳的可伸缩性去满足那些在他们系统上进行商业运作的大批新客户。基于J2EE平台的应用程序可被部署到各种操作系统上。例如可被部署到高端UNIX与大型机系统,这种系统单机可支持至256个处理器。(这是NT服务器所望尘莫及的)J2EE领域的供应商提供了更为广泛的负载平衡策略。能消除系统中的瓶颈,允许多台服务器集成部署。这种部署可达数千个处理器,实现可高度伸缩的系统,满足未来商业应用的需要。

3.5稳定的可用性:

一个服务器端平台必须能全天候运转以满足公司客户、合作伙伴的需要。因为INTERNET是全球化的、无处不在的,即使在夜间按计划停机也可能造成严重损失。若是意外停机,那会有灾难性后果。J2EE部署到可靠的操作环境中,他们支持长期的可用性。一些J2EE部署在WINDOWS环境中,客户也可选择健壮性能更好的操作系统如Sun Solaris、IBM OS/390。最健壮的操作系统可达到99.999%的可用性或每年只需5分钟停机时间。这是实时性很强商业系统理想的选择。

4 服务的发展框架

所开发的某某框架促进了使用POJO来实现业务逻辑。业务逻辑必须声明为接口。所有的服务实现必须实现一个或多个业务接口。这是建议自定义业务服务层抛出异常时,有业务规则验证

6

附录3 外文文献译文

错误。该开发某某框架采用声明式事务管理办法的基于Spring框架。这是通过使用面向方面编程(AOP)。

5 中间层集成

所开发的某某框架支持的Hibernate使用,直接使用JDBC调用来访问关系数据库。这是推荐使用Spring框架的模板类:通过直接的JDBC的JdbcTemplate andHibernateTemplate来访问关系数据库,它是建议application'sDAOs延长fromSpring框架的JdbcDaoSupport。管理中的JdbcTemplate类访问数据库使用的资源(例如PreparedStatement的)。发达某某框架插入到应用程序配置文件使用的DAO数据源。当使用Hibernate来访问关系型数据库,Hibernate的SessionFactory的注入到应用程序通过应用程序的DAO配置文件。

6 开发生命周期

所开发的某某框架的结构使重点清晰的定义角色及其相互关系的一个开发团队。下面介绍三种角色。这种角色之间的互动是成功的关键完成应用开发。(1)前端开发者专注于开发的JSP,动作/ ActionForm的类和Web服务。(二)服务商主要集中在开发和集成应用服务由这些服务所使用的应用程序的不同部分。(三)整合开发的重点是发展一体化如DAO的文物,或使用Web服务。

7 J2EE 的结构

这种基于组件,具有平台无关性的J2EE 结构使得J2EE 程序的编写十分简单,因为业务逻辑被封装成可复用的组件,并且J2EE 服务器以容器的形式为所有的组件类型提供后台服务. 因为你不用自己开发这种服务, 所以你可以集中精力解决手头的业务问题。

7

附录3 外文文献译文

容器和服务容器设置定制了J2EE服务器所提供得内在支持,包括安全,事务管理,JNDI(Java Naming and Directory Interface)寻址,远程连接等服务,以下列出最重要的几种服务:

J2EE安全(Security)模型可以让你配置 web 组件或enterprise bean ,这样只有被授权的用户才能访问系统资源. 每一客户属于一个特别的角色,而每个角色只允许激活特定的方法。你应在enterprise bean的布置描述中声明角色和可被激活的方法。由于这种声明性的方法,你不必编写加强安全性的规则。

J2EE 事务管理(Transaction Management)模型让你指定组成一个事务中所有方法间的关系,这样一个事务中的所有方法被当成一个单一的单元. 当客户端激活一个enterprise bean中的方法,容器介入一管理事务。因有容器管理事务,在enterprise bean中不必对事务的边界进行编码。要求控制分布式事务的代码会非常复杂。你只需在布置描述文件中声明enterprise bean的事务属性,而不用编写并调试复杂的代码。容器将读此文件并为你处理此enterprise bean的事务。 JNDI 寻址(JNDI Lookup)服务向企业内的多重名字和目录服务提供了一个统一的接口,这样应用程序组件可以访问名字和目录服务.

J2EE远程连接(Remote Client Connectivity)模型管理客户端和enterprise bean间的低层交互. 当一个enterprise bean创建后, 一个客户端可以调用它的方法就象它和客户端位于同一虚拟机上一样.

生存周期管理(Life Cycle Management)模型管理enterprise bean的创建和移除,一个enterprise bean在其生存周期中将会历经几种状态。容器创建enterprise bean,并在可用实例池与活动状态中移动他,而最终将其从容器中移除。即使可以调用enterprise bean的create及remove方法,容器也将会在后台执行这些任务。

8

附录3 外文文献译文

数据库连接池(Database Connection Pooling)模型是一个有价值的资源。获取数据库连接是一项耗时的工作,而且连接数非常有限。容器通过管理连接池来缓和这些问题。enterprise bean可从池中迅速获取连接。在bean释放连接之可为其他bean使用。

容器类型

J2EE应用组件可以安装部署到以下几种容器中去:

EJB 容器管理所有J2EE 应用程序中企业级bean 的执行. enterprise bean 和它们的容器运行在J2EE 服务器上.

Web 容器管理所有J2EE 应用程序中JSP页面和Servlet组件的执行. Web 组件和它们的容器运行在J2EE 服务器上. 应用程序客户端容器管理所有J2EE应用程序中应用程序客户端组件的执行. 应用程序客户端和它们的容器运行在J2EE 服务器上. Applet 容器是运行在客户端机器上的web浏览器和 Java 插件的结合.。

7 结论

在本文中,作者提供了一个发展纵览J2EE框架。笔者曾处理的重要建筑主题,技术和发展的步骤,应该考虑在一个J2EE项目。这些信息取自现实世界的经验,旨在帮助开发人员构建的J2EE系统,并设计自己的自定义框架。然而,这仅仅是冰山一角,因为没有简短文件,可以详细描述了J2EE的潜在影响科学和企业应用,特别是基于Web为基础的非线性分析模拟软件。

9

附录4 外文文献原文

附录4 外文文献原文

Defining methodologies for developing J2EE web-based information systems

1. Introduction

Software tools and packages for the nonlinear analysis of complex spatial–dynamic systems increasingly use Web-based networking platforms for the implementation of their user interface, scientific analysis, distribution of simulation results, and information exchange among scientists.The real-time Web-based access to nonlinear analysis simulation software becomes a critical part of many applied systems.The intensive technological change in networking hardware and software provides more freedom of choices than in the past . The current stage of Web development is characterized by the emergence of a significant number of open source frameworks.Frameworks shift the focus of Web development to a higher level, allowing the reuse of basic functionality and thus increasing the productivity of development.In some cases, open source frameworks do not provide a solution to common problems. For this reason, developers build their own development framework on top of an open source framework.Even across unique functional requirements, there are commonly occurring patterns of use cases, which lend themselves to design and development reuse.

2. Major technologies of the developed framework

2.1. Layers and separation of code and configuration

1

附录4 外文文献原文

Web applications have various design concerns such as presentation, business logic, data access and security. A separation of design concerns into distinct code layers has several advantages such as: ease of maintenance, the ability to implement good design patterns, and the ability to select specialized tools and techniques for specific concerns. Separating a project into layers can result in dependencies between those layers. For example, a single-use case involving simple data entry and inquiry usually must integrate presentation, business logic and data access together to deliver required functionality . Therefore, there must be a well defined strategy to manage the dependency relationships. The developed XYZ framework combines design patterns, reusable code and configuration files to make this as easy as possible. This framework uses Spring’s Inversion of Control to manage dependencies.

The developed XYZ framework consists of two distinct parts: code and configuration. Code resides in a particular application layer and focuses on a particular piece of the application solution. This could be interacting with a database, or presenting data to the screen. Configuration glues the various layers of the application together. Separating configuration from code allows us to manage configuration independently, giving us the flexibility of applying different configurations to the same code base. For example, a Data Access Objects (DAO) implementation knows that it is using JDBC to connect to a database through a data source, but it does not know anything about the implementation of that data source. It may come from a Java Naming and Directory Interface (JNDI) context or be derived from a driver manager. It may point to the remote database or a local database. Regardless of where the data source comes from, the DAO implementation will operate on the data source in the same manner. Likewise, a Service object may depend on a DAO, but it does not know whether the DAO is implemented via

2

附录4 外文文献原文

Hibernate, straight JDBC, or aWeb service. Spring gives us a way to manage our application’s entire configuration through a Spring application context, defined by a set of XML files.We could define the application context in one file. However, by defining it in groups of smaller files, we can simplify configuration management. A logical set of such application context files which forms a complete application configuration is called a configuration set.

Spring gives us a way to manage our application’s entire configuration through a Spring application context, defined by a set of XML files.We could define the application context in one file. However, by defining it in groups of smaller files, we can simplify configuration management. During the development of Java-based enterprise applications the standard configuration is where a framework's configuration set uses external resources such as data sources and JNDI resources. This type of configuration sometimes can create problems with: (1) An incomplete database that has not yet been loaded. Developers may want to test the display of certain types of data, but if the underlying database has not yet been completed, they will not be able to do this. (2) Services or DAOs that may not have been developed yet. These issues decrease productivity. The developed XYZ framework has separated its configuration from its code, we can use an alternate configuration set targeted specifically towards development. This relieves us from worrying about the availability of external systems, which are irrelevant to solving immediate development needs.The developed XYZ framework defines two configuration sets: default and standalone. We can also customize our application by adding additional configuration sets based on our project needs. The developed XYZ framework is configured by its application context. The application context may be defined in one or more XML files. A configuration set is a set

3

附录4 外文文献原文

of XML files that define one application context. The configuration set consists of two parts: service andWeb.

2.2. Classes and dependencies

Using the developed XYZ framework, the following code and configuration artifacts will be typically required to develop a user interface screen: (a) Action, ActionForm classes and validation.xml entries; (b) service interface and implementation class; (c) DAO interface and implementation class; (d) dependency management between all of the above. When starting development for a use case, we must be aware of the need of all these classes and their dependencies upfront.

2.3 Testing technology

Testing should be an integral part of the development process. For applications built using the developed XYZ framework,unit testing means testing methods of a single class in the service or integration layer.In order to perform different types of testing, the application being developed must be testable. Let us list some of the basic characteristics of a testable application. (1) Ease of developing unit and integration tests. We should be able to unit test without necessarily using data sources, or queues. Also, we should be able tomock dependencies of code under test. (2) Ease of simulating various test scenarios for functional testing. (3) Ease of re-running all tests repeatedly over the life cycle of the application. (4) Clean separation of testing code from application code.

4

附录4 外文文献原文

2.4 Web presentation design

The developed XYZ framework uses the Struts framework concepts and JavaScript to implement presentation concerns and provides additional features that can be extended for use in projects.When using the Struts framework for development,at firstwe set up the Action Servlet inweb.xml; thenwe set up configuration, actionmappings, formbeans and local forwards in the struts-config.xml; and finally we set up validation rules in validation.xml. There are two types of validations that are required: data format validation and business logic validation. Data format validations are best done in the presentation layer, while business logic validations are best done in the services layer. Business logic validation errors, which occur in the service layer, should be handled by throwing custom exceptions.

2.5. Database access

Applications builtwith the developed XYZ framework support the use of direct JDBC and Hibernate framework to persist in sending data to relational databases. The application is configured with the necessary Spring context files. DAOs that use direct JDBC must extend from Spring framework's JdbcDaoSupport.java class. Similarly, DAOs that use Hibernate must extend from Spring framework's HibernateDaoSupport.java class.

2.6 Configuration through annotation

The developed XYZ framework uses the Spring framework to maintain

5

附录4 外文文献原文

dependencies between code artifacts in applications. Some of these dependencies (e.g.betweenAction and ActionForm) are configured in \"struts-config.xml\some others (e.g. between Service and DAO) are configured in Spring application context files (applicationContext.xml). In a team environment these configuration files are shared by developers. That is why version conflicts on these configuration files might occur. The developed XYZ framework provides a newefficient approach that uses special annotations to specify all of these dependencies. By using these annotations, configurations become simpler and conflicting changes to configuration artifacts are avoided.

3 the J2EE advantage

3.1 retain existing IT assets:

Because enterprise must adapt to the new commercial demand, by means of the existing enterprise information system < http://baike.baidu.com/view/1508462.htm > investment, not redefining overall scheme is very important. So, a gradual (not radical, completely negative) way above the existing system established the server platform mechanism is not fair that the company needs. Can make full use of the user J2EE, as some of the original investment companies use the Tuxedo, IBM CICS BEA, IBM VisiBroker Inprise Encina,, and Netscape apply Server. This is possible because the J2EE extensive industry supported and some important 'enterprise computing' field supplier to participate. Each supplier to existing customer provides no abandoned existing investment into portable J2EE field upgrade path. Based on the J2EE platform because the product can almost http://baike.baidu.com/view/880.htm in any operating system

6

附录4 外文文献原文

< > and hardware configurations to run on existing operating system and hardware can also be retained use.

3.2 efficient development:

The J2EE allows companies to some generic, very tedious tasks to a server to complete the middle suppliers. So developers to focus on how to create business logic < >, http://baike.baidu.com/view/1569065.htm accordingly shorten the development time. Senior middleware vendors provide the following these complex middleware services: o state management service -- let developers to write less code >, <

http://baike.baidu.com/view/41.htm didn't care how to manage state, so can complete application development faster. O persistent services - lets developers don't have to encode data access logic can write applications that can generate a lighter, and database irrelevant applications, this application easier to development and maintenance. O distributed share data object http://baike.baidu.com/view/178571.htm > CACHE service - \"let a developer prepare high-performance systems, greatly enhance the loft deployment.

Heterogeneous environment:

3.3 support

The J2EE can develop the heterogeneous environment can be deployed in http://baike.baidu.com/view/17674.htm transplant programs < >. Based on the J2EE application is not dependent on any specific operating system, middleware, hardware.

7

附录4 外文文献原文

So the reasonable design based on J2EE program just can be deployed to develop a various platforms. This in a typical heterogeneous enterprise computing environment is very critical. The J2EE standard also allows customers to order and J2EE compatible third-party ready-made components, put them to deploy on heterogeneous environment, save by oneself make of the cost of the whole scheme.

3.4 scalability:

Enterprise must choose a server not fair Taiwan, the platform should be able to offer excellent scalability to satisfy those in their system on the large number of new customers of commercial operation. Based on the J2EE platform application can be deployed to all operating systems. For example can be deployed to high-end UNIX and mainframe systems, this system can support single to 256 processor. (this is exceed NT server supplier of the) J2EE field provides a more extensive load balancing strategy. Can eliminate system bottlenecks, allow multiple servers integration to deploy. The deployment of thousands of processors, realize flexible system, highly satisfied future commercial application needs.

3.5 stable usability:

A server platform must be able to round-the-clock operation not fair to meet the needs of our customers, partners. Because the INTERNET is the globalization, everywhere, even at night as planned downtime also may cause serious damage. If it hangs, it will have disastrous consequences. The J2EE deployed to reliable operating environment, they support long-term usability. Some J2EE deployed in WINDOWS

8

附录4 外文文献原文

environment, customers also can choose to robust performance better operating systems such as from Solaris, IBM OS / 390. The most robust operating system can achieve 99.999% availability or just 5 minutes downtime every year. This is

http://baike.baidu.com/view/561051.htm real-time strong > business systems \"ideal choice.

4Services of the developed framework

The developed XYZ framework promotes the use of Plain-Old-Java-Objects (POJOs) to implement business logic. Business logic must be declared as interfaces. All service implementations must implement one or more business interfaces. It is recommended that the service layer throws custombusiness exceptions when there are business rule validation

errors.

The

developed

XYZ

framework

adopts

a

declarative

transactionmanagement approach based on the Spring framework . This is implemented using Aspect Oriented Programming (AOP).

5 Middle layer integration

The developed XYZ framework supports the use of Hibernate and direct JDBC calls to access relational databases. It is recommended to use Spring framework’s template classes: JdbcTemplate andHibernateTemplate.When using direct JDBC to access relational databases, it is recommended that the application’sDAOs extend fromSpring framework’s JdbcDaoSupport. The JdbcTemplate class manages resources used in accessing databases (for example PreparedStatement). The developed XYZ framework inserts the data source into DAOs using application configuration files. When using

9

附录4 外文文献原文

Hibernate to access relational databases, the Hibernate SessionFactory is injected into the application DAOs through application configuration Files.

6 Development life cycle

The developed XYZ framework’s emphasis on structure enables clear definition of roles and their interactions in a development team. Three roles are described below. An interaction between such roles is critical to the successful completion of application development. (a) Front end developers are focused on developing JSPs, Action/ActionForm classes and exposing Web services. (b) Services developers are focused on developing application services and integrating the different parts of the application used by these services. (c) Integration developers are focused on developing integration artifacts such as DAOs, or consumingWeb services.

7 Conclusion

In this paper, the author has provided an overviewof the developed J2EE framework. The author has addressed important architecture topics, technologies and development steps that one should consider in a J2EE project. The information is taken from real-world experiences, and is intended to help developers build J2EE systems, and design their own custom frameworks. This, however, is just the tip of the iceberg, as no short paper could describe in detail J2EE’s potential impact on scientific and enterprise applications and, especially, on Web-based simulation software for nonlinear analysis.

10

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- huatuo7.cn 版权所有 湘ICP备2022005869号-9

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务