摘 要
大多数网上商店系统是基于两层体系结构来进行设计和开发的,在很大程度上限制了其进一步发展和应用。Internet的快速发展,对网上商店提出了新的要求。传统的两层体系结构面临着严峻的挑战,其中最为突出的问题是开发负担重、维护困难等。
本文在分析了目前网上商店所面临的问题后,采用J2EE平台,开发高可扩展性、可靠性以及可重用性的网上商店系统模型,以满足现实生活的需要。
在采用J2EE平台组建网上商店系统时,需要将应用系统分为三个层次,即表示层、业务层及数据库层。表示层向客户的浏览器提供Web方式下的显示内容;业务层处理客户在购物中的各种请求;数据层则向系统提供数据。采用这种层次结构可以提高系统的扩展性和服务器的效率。
网上商店系统中需要采用多种设计模式来提高系统性能。系统采用前台控制器来方便的实现导航;采用复合视图来向用户提供Web显示,降低了视图中的重复代码;采用业务代表降低各层次之间的耦合;并在业务层中采用值对象来向表示层提供数据。
最后本文采用这种方式实现了一个网上商店实例DM-ONLINE,DM-ONLINE系统使用了J2EE中的多种技术,合理利用了各种技术的优势。采用JSP技术生成用户视图,Java Servlet进行前台控制,EJB提供后端的商业逻辑。另外还采用与JSP结合的很好的JavaBean向前台提供数据并处理一些简单逻辑。
DM-ONLINE系统使用JBuilder5集成开发环境作为开发平台,DM3作为后台数据库,并实现了在BAS4.5上的部署。
关键字:J2EE平台,多层体系结构,网上商店,设计模式,部署
Topic: Design and Implementation of J2EE-based E-Store
Abstract
Majority E-store system used two tier architecture, to a large extent this limited its further development and apply. The improvement of Internet raised E-store system new requirement. Traditional of two tier architecture faced rigorous challenges, and among them the most problem is the heavy burden of development and the difficult of maintenance etc.
In this paper, we analyzed the shortcomings of current E-store, and adopted J2EE platform to develop higher scalability, higher reliability E-store module to satisfy the requirement.
When adopt J2EE platform to set up an E-store system, we can divide the application to three tier. They are presentation tier, business tier and database tier. The presentation tier provide the view for the browser, the business tier handle the request of client and the database tier provide data for application. Such three tier architecture can improve application’s scalability and server’s efficiency.
E-store system can use several design patterns to improve the performance. We use front controller to realize convenience navigate. We use composite view which lower the reduplicative code to provide the view. We use business delegate to lower the coupling between two tiers. And we use value object to provide data for the presentation tier.
At last, this paper adopts this module to realize an instance of E-store, DM-ONLINE. This application adopts several technology of J2EE, such as JSP , Servlets, EJB and so on.
DM-ONLINE system usage the JBuilder5 which is an integrated develop- ment environment as it’s development environment, DM3 DBMS as it’s databaset, and realizes in the deploy on the BAS4.5.
Keywords: J2EE Platform, Multi-tier Application, E-store, Design Pattern, Deploy