基于WEB的J2EE的信息系统的方法研究_第1页
基于WEB的J2EE的信息系统的方法研究_第2页
基于WEB的J2EE的信息系统的方法研究_第3页
基于WEB的J2EE的信息系统的方法研究_第4页
基于WEB的J2EE的信息系统的方法研究_第5页
已阅读5页,还剩23页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Research on the method of J2EE based WEB information system班级: 11网工2班 学号: 1104032015 姓名: 荣振 指导老师签字: 摘要:本文介绍基于项目的Java开发框架背后的概念,并介绍它如何用于IT项目开发。因为有许多相同设计和开发工作在不同的方式下重复,而且并不总是符合最佳实践,所以许多开发框架建立了。我们已经定义了共同关注的问题和应用模式,代表有效解决办法的工具。开发框架提供:(1)从用户界面到数据集成的应用程序开发堆栈;(2)一个架构,基本环境及他们的相关技术,这些技术用来使用其他一些框架。架构定义了一个开发方法,

2、其目的是协助客户开发项目。Abstract: This paper describes the concept behind the project based Java development framework, and describes how it is used for IT project development. Because there are a lot of same design and development work in a variety of ways to repeat, and does not always comply with the best p

3、ractice, so many of the development framework is established. We have defined the common concerns and application patterns that represent effective solutions to the tools. Development framework provides: (1) from the user interface to the data integration application development stack; (2) an archit

4、ecture, environment and their related technologies, these technologies to use some other frameworks. The architecture defines a development method that is intended to assist the client development project.关键词:J2EE 框架 WEB开发Keywords: J2EE framework WEB developmentI. Introduction 软件工具包用来进行复杂的空间动态系统的非线性

5、分析越来越多地使用基于Web的网络平台,以实现他们的用户界面,科学分析,分布仿真结果和科学家之间的信息交流。对于许多应用系统基于Web访问的非线性分析模拟软件成为一个重要组成部分。网络硬件和软件方面的密集技术变革1提供了比过去更多的自由选择机会2。因此,WEB平台的合理选择和发展对整个地区的非线性分析及其众多的应用程序具有越来越重要的意义。现阶段的WEB发展的特点是出现了大量的开源框架。框架将Web开发提到一个更高的水平,使基本功能的重复使用成为可能和从而提高了开发的生产力。 Software toolkit for complex spatial dynamic nonlinear anal

6、ysis more and more land use based on the network platform of the web and to achieve their user interfaces, scientific analysis, the distribution of the exchange of information between the simulation results and the scientist. For many application systems, the nonlinear analysis based on Web access i

7、s an important part of the simulation software. The dense technological change in the network hardware and software aspects of 1 offers more freedom than in the past to choose opportunity 2. Therefore, the reasonable choice and development of the WEB platform have a more and more important significa

8、nce for the nonlinear analysis of the whole region and its application program. At this stage, the development of WEB is characterized by a large number of open source frameworks. The framework will develop the Web to mention a higher level, so that the basic functions of the reuse become possible a

9、nd thus improve the productivity of the development.在某些情况下,开源框架没有提供常见问题的一个解决方案。出于这个原因,开发在开源框架的基础上建立自己的项目发展框架。本文旨在描述是一个基于Java的框架,该框架利用了开源框架并有助于开发基于Web的应用。通过分析现有的开源框架,本文提出了新的架构,基本环境及他们用来提高和利用其他一些框架的相关技术。架构定义了自己开发方法,其目的是协助客户开发和事例项目。In some cases, the open source framework does not provide a solution fo

10、r common problems. For this reason, the development framework of the project development is based on the open source framework. This paper is intended to describe a framework based on Java, which exploits the open source framework and helps to develop Web based applications. By analyzing the existin

11、g open source frameworks, this paper presents new architectures, basic environment and their use to improve and exploit some of the relevant technologies of other frameworks. The architecture defines its own development methodology, which is intended to help clients develop and project examples.应用程序

12、设计应该关注在项目中的重复利用。即使有独特的功能要求,也有常见的可用模式使用,这使得它们的设计和开发能重用。本文介绍了一个“自定义”框架,这个框架用来定义能被开发者使用的相同的应用问题和定义设计模式。这个框架,我们将称之为某某开发框架,提供了一套模式和工具,建立了行业最佳实践,使之适合常见的应用问题。它提供了一个从表示到集成的应用程序开发堆栈。本文阐明了这些应用问题和模式,工具和行业最佳实践。某某开发框架可以根据各种项目的需求进行定制。它的开发和配置是基于诸如Struts、Spring、Hibernate和JUnit之类的各种框架和工具。Application design should fo

13、cus on the reuse of the project. Even if there are unique functional requirements, there are common patterns of use, which makes them reusable design and development. This paper describes a custom framework that defines the same application issues and design patterns that can be used by developers.

14、This framework, which we call so and so development framework, provides a set of patterns and tools that establish the industry best practices that make it suitable for common application issues. It provides a stack of application development from presentation to integration. This paper illustrates

15、these application issues and patterns, tools and industry best practices. Certain development framework can be customized according to the needs of various projects. Its development and configuration are based on frameworks and tools such as Spring, Struts, Hibernate, and JUnit.Two, the main technol

16、ogy of the development frame2.1 代码和配置的层与层之间的分离2.1 separation between layers of code and configurationWeb应用程序有各种设计问题,如表现,商业逻辑,数据存取和安全性。不同的代码层的分离设计有如下几个方面的优势,如:便于维修,实施良好设计模式的能力,选择专门的工具的能力和具体问题的解决技术。将一个项目进行层与层之间的分离导致了这些层之间的依赖关系。例如,一个简单的使用案例,它涉及数据的输入和查询通常必须整合表示,业务逻辑和数据访问以达到所需的功能3 。因此,必须有一个明确的策略来管理这些依赖关系

17、。开发框架包括设计模式,可复用的代码和配置文件,使开发框架尽可能地容易的被使用。这一框架使用Spring的反向控制来管理相依。 Spring框架4提供了一种方法整合各层成为一个应用项目。它通过Spring应用上下文来完成这一目标,这是一个对象之间管理依赖策略。Spring使用的依赖注入和拦截技术介绍如下。 Web applications have various design issues such as performance, business logic, data access and security. Different code layer separation design

18、has the following advantages, such as ease of maintenance, ability to implement the good design model, choose the ability of specialized tools and specific problems. The separation of a project between the layers of a project leads to a dependency between these layers. For example, a simple case of

19、use, which involves data entry and query usually must be integrated, business logic and data access to achieve the required function 3. Therefore, there must be a clear strategy to manage these dependencies. The development framework consists of design patterns, reusable code and configuration files

20、, making the development framework as easy as being used. This framework uses Springs reverse control to manage dependencies. Spring framework 4 provides a way to integrate layers into an application project. It is accomplished by the Spring application context, which is a dependency strategy betwee

21、n the object management. Spring relies on injection and interception techniques are described as follows.我们所写的代码依赖于使用的对象。它负责创建这些对象。这可能导致紧耦合的,但我们希望我们的代码是松散耦合。依赖注入是一个技术,可以帮助我们实现这一目标。依赖注入是反向控制(IOC)的一种形式5。当应用程序使用依赖注入时,代码将变得更加清洁和容易。这就是松耦合,从而更容易配置和测试。开发框架使用了多个Spring应用背景文件来定义层与层之间的依赖关系。方法拦截是面向方面编程(AOP)概念6。

22、Spring AOP方法拦截是通过JDK动态代理来实现的。开发框架使用Spring AOP来管理问如交易管理和性能监测等问题。 The code we write depends on the use of the object. It is responsible for creating these objects. This may cause tight coupling, but we want our code to be loosely coupled. Dependency injection is a technique that can help us achieve th

23、is goal. Dependency injection is a form of backward control (IOC) 5. When the application uses dependency injection, the code will become cleaner and easier. This is loosely coupled, and thus easier to configure and test. The development framework uses a number of Spring application background files

24、 to define dependencies between layers. The method is to intercept the aspect oriented programming (AOP) concept 6. AOP Spring method is implemented by JDK dynamic proxy. The development framework uses AOP Spring to manage issues such as transaction management and performance monitoring.开发框架包括两个不同的部

25、分:代码和配置。代码位于一个特定的应用层,并侧重于某一特定条件中的应用解决方案。这可能要与数据库交互,或将数据显示给屏幕。配置将应用的各个层联系在一起。从代码中分离出配置使我们能够独立管理配置,使我们在同一代码基础上方便的进行不同的配置。例如,数据访问对象(DAO)知道它是使用JDBC通过数据源来连接一个数据库的,但它不知道该数据源是如何实现的。它可能是一个Java命名和目录接口(JNDI上下文或是来自驱动程序。它可以指向远程数据库或本地数据库。无论数据来自何处,DAO执行操作数据源的方式是相同的。同样,服务对象可能依赖于DAO ,但不知道DAO是如何实现,可能通过Hibernate,直接的J

26、DBC ,或Web服务。互动服务对象与DAO有相同的方式,而不管DAO的实现。 The development framework consists of two different parts: code and configuration. Code is located in a particular application layer, and focuses on a particular condition of the application solution. This may interact with the database or display data to the

27、screen. Configure all layers of application to contact. From the separation of the code configuration so that we can independently manage the configuration, so that we can easily carry out different configurations based on the same code. For example, the data access object (DAO) knows that it is con

28、nected to a database using the JDBC data source, but it does not know how the data source is implemented. It could be a Java naming and directory interface (JNDI context or a driver. It can point to a remote database or a local database. Regardless of where the data come from, the way DAO performs t

29、he operation data source is the same. Similarly, service objects may depend on DAO, but do not know how DAO is implemented, possibly through Hibernate, direct JDBC, or Web services. The interactive service object has the same way as DAO, regardless of the DAO implementation.Spring通过Spring应该上下文来管理我们的

30、应用程序的整个配置,这些配置是一些XML文件。我们可以在一个文件中定义应用的环境。然而,我们可以在较小的文件中定义它来简化配置管理。这样的应用环境文件的逻辑集合组成了一个被称之为配置集的完整的应用配置。 Spring should be context to manage the entire configuration of our application, these configurations are some XML files. We can define the application environment in a file. However, we can define i

31、t in smaller files to simplify configuration management. Such a logical collection of the application environment files is composed of a complete application configuration called the configuration set.开发基于Java的企业应用的标准配置是在一个框架的配置中设置使用如数据源和JNDI的资源的外部资源。这种类型的配置有些时候可能带来如下问题:(1)尚未加载完全的数据库。开发人员可能要测试某些类型的数

32、据的显示,但如果基础数据尚未完成,他们将无法做到这一点。(2)服务或DAOs可能还未被开发。整合未完成的服务或DAOs可能阻碍发展的进程。 The standard configuration of enterprise application based on Java is the external resources for the use of resources such as data source and JNDI in the configuration of a framework. This type of configuration may sometimes have

33、the following problem: (1) not yet load the complete database. Developers may want to test the display of some types of data, but if the basic data is not yet completed, they will not do this. (2) services or DAOs may not be developed. The integration of the unfinished service or DAOs may hinder the

34、 development of the process.这些问题降低了生产力。开发框架已从它的代码中分散其配置,我们可以针对开发使用有选择的配置集。这可以减轻我们对外部系统的可用性的担心,这对于解决开发的中间需求是不相关的。 These questions reduce productivity. The development framework has been decentralized from its code, and we can develop a selection of configuration sets for the development. This can eas

35、e the concerns of our external system availability, which is not relevant for developing intermediate requirements.开发框架定义了两种配置集:默认和独立。我们还可以自定义应用,来增加基于我们项目需要的额外配置集。默认配置使用在JNDI中的定义的数据源来连接数据库。它完全使用了应用服务和DAOs 。独立的配置设置对开发而言是最灵活的。此配置集:(1)使用DriverManagerDataSource连接到任何本地安装的数据库或开发数据库;(2)使用Spring的DataSourceT

36、ransactionManager作为本地事务管理;(3)利用充分开发应用服务和DAOs;(4)充分利用Spring应用上下文在应用服务器以外进行运行和测试。 The development framework defines two sets of configurations: default and independence. We can also customize the application to increase the additional configuration set based on our project needs. The default configura

37、tion uses a data source defined in JNDI to connect to a database. It is fully used for application services and DAOs. Independent configuration settings are the most flexible for development. This configuration set: (1) using drivermanagerdatasource connected to any local installation database or da

38、tabase development; (2) using spring datasourcetransactionmanager as a local transaction management; (3) using the full exploitation of application services and Daos; (4) make full use of the spring application context outside the application server operation and test.开发框架通过它的应用上下文进行配置。应用上下文被定义一个或多个

39、XML文件。一个配置集是定义一个应用上下文的一套XML文件。配置集包括两部分:服务和网络。该服务定义了整合过程中的DAOs和资源。一个配置不能同时完成这些部分。 The development framework is configured by its application context. Application context is defined for one or more XML files. A configuration set is a set of XML files that define an application context. The configurati

40、on set consists of two parts: service and network. The service defines the DAOs and resources in the integration process. A configuration cannot complete these parts at the same time.开发框架配置集通过被Spring称之为bean映射上下文组合到一起,这些映射在beanRefContext.xml和applicationContextMperties 中定义。beanRefContext.xml文件定义所有的配置的

41、服务部分。此文The development framework configuration set is defined by Spring as the bean mapping context, which is defined in applicationContextMperties and beanRefContext.xml. BeanRefContext.xml file defines all the configured services section. This file is located in the Src / service project configura

42、tion directory. Shared between application context is achieved by configuring the configuration in this directory. In addition, each configuration has its own sub directory, which contains its own specific configuration. For example, services and DAOs are shared by the configuration set, while the s

43、upport services (such as data sources) belong to the sub directory. XML file in the application by using tags to define the bean Spring. Bean Spring is a Java object and initialized by application context.2.2 kinds and their relationship利用开发框架,在一个典型项目中有如下的代码和配置:(a)Action,ActionForm类和validation.xml文件

44、;(b)服务接口和实现类;(c)DAO接口和实现类;(d)以上这些的关系管理。当我们开始我们例子的开发时,我们必须认识到所有这些类和他们的关系的重要性。 The framework is developed, with the following code and configuration in a typical project: (a) action and ActionForm class and validation.xml documents; (b) service interfaces and implementation classes; (c) Dao interfaces

45、 and implementation classes; (d) above the relationship management. When we start our example of development, we must recognize the importance of all these classes and their relationships.2.3 测试技术2.3 test technology测试应是项目开发过程中的一个不可分割的组成部分的。使用开发框架建立的应用程序,单元测试是指只测试服务或集成层的单一类。表现层(Action类)不执行单元测试。这种测试的目

46、的是保证每个类的行为封装与预期一致。项目中的单元测试是基于JUnit框架的7。与单元测试不同,集成测试需要测试代码之间的相互依赖性。这种测试的目的是以确保各个不同的类(不同的开发者开发的)整合在一起时也能想期望一样的运作。在功能测试过程中,重点是采用不同的场景进行功能的测试。典型的功能测试包括在业务层用不同的数据进行类的测试。 The test should be an integral part of the project development process. Using the development framework to build an application, unit t

47、esting refers to a single class of test service or integration only. The performance layer (Action class) does not perform unit testing. The objective of this test is to guarantee that each class of behavior packages is consistent with the expectation. The unit test in the project is based on the JU

48、nit framework, 7. Different from unit testing, integration testing requires the interdependence among test code. The purpose of this test is to ensure that the integration of different classes (different developer Development) can also be expected to work as expected. In the functional testing proce

49、ss, the focus is on the use of different scenarios for functional testing. Typical functional tests include testing of different data for business layers.为了执行不同类型的测试,项目在开发过程中必须是测试可测试的。下面列出的可测试项目的一些基本特性。(1)开发单元的简单和集成测试。我们可以在没有数据源,或排队的情况下执行单元测试。当然,我们也能模拟相依赖代码而进行测试。(2)有易于进程各种模拟测试场景的功能测试。(3)在整个生命周期中方便重新

50、运行所有测试。(4)从应用代码中清楚的分离出测试代码来。 In order to perform different types of tests, the project must be testable in the development process. Some basic features of the testable project listed below. (1) the simple and integrated test of the development unit. We can perform unit tests without a data source, o

51、r queued. Of course, we can also simulate phase dependent code and testing. (2) the functional test of a variety of simulated test scenarios is easy to process. (3) all tests are easily run over the entire life cycle. (4) the test code is clearly separated from the application code.精心计划应用的各个设计问题,如表示

52、,服务和数据访问对于可测试的应用是非常重要的。应用程序编码以get方法、set方法、变量等开始。单元测试是是其他任何测试方法的基础。开发框架设计的便利的可测试应用开发的方法:提供测试模板类来帮助建立单元测试,使应用更易于配置以适应测试需求。单元测试可以运行像任何JUnit测试。默认的专门开发的“建设脚本”提供了一个任务来运行单元测试。这个任务部署的EAR文件,可以单独运行。The design issues of the carefully planned application, such as the representation, service and data access are

53、important for the application of testable applications. The application code is coded with the get method, the set method, the variable, etc. Unit testing is the basis for any other test method. Develop the easy test application development method of the framework design: provide testing template cl

54、ass to help build unit test, make application more easy to configure to meet the test need. Unit tests can run like any JUnit test. The default build script provides a task to run the unit test. This task can be run independently of the EAR file.2.4 page representation design开发框架采用Struts框架和JavaScrip

55、t来实现页面,并提供可扩展用于另外项目的额外功能。当使用Struts框架进行发展,首先,我们在web.xml配置Servlet Action;然后在struts-config.xml中配置action mapping,form bean 和local forwards;最后我们在validation.xml配置验证规则。 The development framework uses the Struts framework and JavaScript to implement the page and provides additional features for additional p

56、rojects. When using struts framework for development, first of all, we in the web.xml servlet configuration action; then in the struts-config.xml configuration action mapping, the form bean and local forwards; finally, we validation.xml configuration validation rules.这种建立应用程序的方法在开发框架中已经发生了改变,开发人员不必要

57、直接编辑config.xml或validation.xml文件。相反,我们通过XDoclet注释直接在Action和Action Form类中直接配置。这些信息在运行Ant脚本时翻译插入struts-config.xml和validation.xml文件中。This method of building an application has changed in the development framework, and the developers need not directly edit the config.xml or validation.xml files. Instead,

58、 we directly configure the Action and Form Action classes via XDoclet annotations. This information is inserted into the struts-config.xml and validation.xml files when running Ant script.有两种需要验证的类型:数据格式验证和业务逻辑验证。数据格式验证最好在表示层进行,而业务逻辑验证最好的在服务层进行验证。在业务层发生的业务逻辑错误,必须通过抛出异常进行处理。There are two types of ver

59、ification: data format verification and business logic verification. Data format verification is best performed in the presentation layer, while the business logic verifies the best in the service layer for verification. Business logic errors that occur in the business layer must be handled by throw

60、ing exceptions.以下是表现层的设计目标:(1)每个JSP文件只有一个Action类和ActionForm类。一个单一动作类必须处理一个单一的页面;(2)使用XDoclet定义依赖和验证规则;(3)开发人员应该避免或尽量减少使用sessoin对象,因为它阻碍了可扩展性。 The following is the performance layer design goal: (1) each JSP file has only one Action class and the ActionForm class. A single action class must deal with

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论