Web Tier Design Goals
Naïve approaches toward J2EE web tier implementation typically result in JSP pages containing excessive
amounts of Java scriptlets, with a confused mixture of presentation and business logic. The result is an
untestable presentation layer, refactoring headaches, and maintenance hell. Many, if not most, J2EE web
developers have either implemented such applications themselves, when less experienced, or inherited
such code for maintenance and enhancement, cursing the original developers.
This naive JSP-centric programming model owes its origins to ASP and PHP, two popular web programming
environments since 1996. In both, page-centric scripting is the only option, with no easy options
for separating workflow control and view rendering or delegating to business logic components. While
both have advanced since, to ASP.NET and PHP4, respectively, and both now offer better options for
application architecture, the classic programming model unfortunately remains very influential.
There has been consensus in the J2EE community for several years that the web tier in a layered J2EE
application should be better structured than such scripted pages, to offer comparable levels of maintainability,
testability, and reusability as middle tier components. Expert One-on-One J2EE Design and
Development clearly summarizes the central goals for a maintainable and extensible web tier:
❑ A clean web tier separates control flow and the invocation of business objects (handled by Java
controller objects) from presentation (handled by view components such as JSP pages).
❑ The web tier should be as thin as possible: That is, contain no more Java code than is necessary
to initiate business processing from user actions, and display the results. It should contain only
web-specific control logic, not business logic.
The first goal is typically achieved by applying the MVC approach, dividing the web tier into three
kinds of objects:
❑ Controller objects that accept user input and invoke business logic to create and update model
objects
❑ Model objects, providing the data to display, representing the contract between controller
and view
❑ View objects that display model data, as provided by the controller that invoked it
In classic desktop GUI frameworks like Swing, the model pushes updates to registered views. For web
applications, a special variant of MVC applies, due to the fact that web applications are bound to a
request/response cycle that does not allow for dynamic display updates: A controller exposes a model to
the view, the model being specifically prepared for the current request, and the view pulls data from its
model as necessary during rendering.
The second goal (a thin web tier) is often less emphasized than the first, as many web frameworks do not
help to separate web control logic from business logic. This is potentially costly, as lack of separation
between web control logic and business logic can compromise several architectural tiers and lead to
what could be called web-only applications: web applications lacking a reusable business layer. In such
applications, the web controller does not delegate to appropriate reusable business objects but implements
both workflow and business logic itself. While this may be adequate for small applications, it typically
leads to code duplication for similar actions, does not allow for easy testing of business logic, and
prevents reuse of the same business logic in other environments.
分享到:
相关推荐
【WebLogic + WebTier 环境搭建】 在IT领域,构建一个稳定且高效的应用服务器环境是至关重要的,尤其对于企业级应用来说。本篇文档将详细介绍如何在Red Hat Enterprise Linux(RHEL)5.4操作系统上搭建Oracle ...
这个名为"flex-webiter.jar.zip"的压缩文件包含了Flex Webtier的相关库,特别是"flex-webtier.jar"这个子文件,它是Flex Webtier的核心部分。 Flex是由Adobe开发的一种用于创建交互式、动态网页内容的开源框架,它...
在本文中,我们将详细探讨如何搭建一个基于WebLogic Server的WebTier环境,主要涉及操作系统要求、系统参数配置、用户创建、环境变量设置、软件版本检查以及软件安装步骤。这个环境通常用于部署和管理企业级的Java...
《Servlets and JavaServer Pages™: The J2EE™ Technology Web Tier》这本书是关于Java企业级应用开发的重要参考资料,尤其关注Web层的技术。它详细介绍了Servlets和JavaServer Pages(JSP)这两种核心技术,以及...
Oracle Database 11gR2 (ofm_webtier_linux_11.1.1.2.0_64_disk1_1of1.zip) ,适用于 Linux x86-64 的 Oracle Fusion Middleware Web Tier Utilities 11g (11.1.1.2.0) ,包含 Oracle HTTP Server 及相关模块。...
本书《Professional Servlets and JSP The J2EE Web Tier》是Jayson Falkner和Kevin Jones所著,是关于如何使用JavaServer Pages 2.0和Servlets 2.4构建动态Java Web应用的详尽指南。它提供了使用Servlet和JSP技术...
Oracle Database 11gR2 (ofm_webtier_linux_11.1.1.2.0_64_disk1_1of1.zip) ,适用于 Linux x86-64 的 Oracle Fusion Middleware Web Tier Utilities 11g (11.1.1.2.0) ,包含 Oracle HTTP Server 及相关模块。...
J2EE provides many architectural choices. J2EE also offers many component types (such as servlets, EJBs, JSP pages, and servlet filters), and J2EE application ...❑ Web tier design ❑ Portability issues
J2EE provides many architectural choices. J2EE also offers many component types (such as servlets, EJBs, JSP pages, and servlet filters), and J2EE application ...❑ Web tier design ❑ Portability issues
1. 用户界面层(Presentation Tier):这是用户与系统交互的接口,通常由Web页面、桌面应用或移动应用组成。用户输入的数据在这里被收集并发送到下一层处理。 2. 业务逻辑层(Business Logic Tier):这一层包含了...
Interface Tier Design with IFML Chapter 13. Data Persistence Book Details Paperback: 376 pages Publisher: Morgan Kaufmann (February 2014) Language: English ISBN-10: 0124186734 ISBN-13: 978-...
1. **Tier 分级**:Uptime Tier Standard 提供了四个等级(Tier 1, Tier 2, Tier 3, Tier 4),每个等级代表了不同的冗余水平和系统架构复杂度。这些等级旨在满足从基本到高度冗余、故障容错的逐步增强的服务级别。 ...
### Teamcenter Rich Client 2-Tier 安装指南 #### 一、概述 Teamcenter Rich Client 2-Tier是一款由Siemens提供的一款集成化产品生命周期管理(PLM)软件解决方案,它支持用户通过一个功能丰富的界面来访问核心的...
### IBM DS8000 Easy Tier 详析 #### 一、Easy Tier 功能概览 **1.1 Easy Tier 总览** ##### 1.1.1 Easy Tier 基础功能 IBM DS8000 的 Easy Tier 功能是一项重要的自动存储分层技术,旨在提高数据访问性能并降低...
**Tier4级别数据中心详解** 数据中心是企业存放、管理和处理数据的核心设施,对于现代企业和机构的运作至关重要。在数据中心的设计和建设中,国际公认的最高标准是Tier4级别,它基于ANSI-TIA-942-2005标准定义。这...
3. **ASP.NET**:如果这个项目涉及Web应用,那么可能会用到ASP.NET,它是Microsoft提供的一种用于构建动态网站和Web服务的技术。ASP.NET MVC或ASP.NET Core可能是实现UI层的框架。 4. **ADO.NET**:作为.NET框架的...
### Tier分类定义站点基础设施性能 #### 执行摘要 在国际不间断运行社群中广泛接受的Uptime Institute(以下简称“研究院”)的Tier分类与性能标准提供了一个客观比较不同站点基础设施功能性和持续服务能力的基础...
04 Creating the Web Tier Using JavaServer Pages 05 Creating the Web Tier Using JavaServer Faces 06 Controlling Navigation and Data Flow with JSF 07 Creating the Business Tier: Enterprise JavaBeans...
http://www.oracle.com/technetwork/middleware/webtier/downloads/index.html Oracle WebLogic Web Server Plug-Ins 12c WebLogic Web Server Plug-In 12c is backward compatible with WebLogic Web Server ...