Struts概述

以下是资料介绍,如需要完整的请充值下载. 本资料已审核过,确保内容和网页里介绍一致.  
无需注册登录,支付后按照提示操作即可获取该资料.
资料介绍:


附件1 外文资料翻译译文



Struts概述

MVC和用户接口

  MVC是由于Smalltalk而首先普及并且成为当前比较流行的框架模式的。使用MVC的主要益处之一是它提供了接口间可以重用和交互的组件。Swing对于Java用户来说的确是一个好消息,但是Struts在网络扩展方面却有所减少。虽然Struts提供了更多的重用机制,但是还有许多组件穿插在页面中作为Swing的改良来使用。和Struts一样,JSF的目标是JAVA网络应用, 但是它更接近Swing,它更集中在用户接口单元(或组件)的重用上。

MVC模式

  我们开始从传统形式上描述MVC然后讨论它如何能适应网络的应用。MVC模式三个部分中任一个都是经过检验的,他们分别执行相应的公共模块。这个模式的主要意图是分成三个相互独立的交互的模块:模型,视图和控制器。模型的核心是一个逻辑函数,视图是用来显示用户应用程序传递的数据,而控制器是控制用户的交互和输入的。 三者的通信是通过一个变换装置保持协调同步的。

动机

  一个应用软件最灵活多变的部分就是用户接口(或者视图),因为他是和用户直接通信的。换句话说,它是多数软件系统的最可视部份。此外在需求方面每天都改变,你的软件也可能需要同时支持多个操作系统(如Windows,LINUX,苹果等等),而且每个人的视觉感也不同。像这样非常复杂的系统就需要一个通俗易用的用户接口。在有极高联系的电路设计软件中,一个很小的改变都会有至命的错误倾向。一个小小的改变也许会影响到整个系统。此外,有时用户要求同一种应用软件能在不同的平台上运行。

解决办法

  对于在统一的应用接口下的模型,视图和控制器三者的耦合问题,MVC模式给予了灵活的解决办法。 如果以下条件成立,它将是个不错的选择:





附件2 外文原文



Struts Overview

MVC and User Interfaces

  MVC was first popularized with Smalltalk and is now used in many modern user interface frameworks. One of the primary benefits of MVC is that it provides reusable components for interactive user interfaces. Swing does this admirably for rich Java clients, while Struts does so to a lesser extent on the Web. Even though the introduction of Tiles to Struts provides more reuse, the components are still more page-centric as opposed to Swing's more fine-grained widget-centric approach. Like Struts, JSF is targeted at JAVA Web applications, but moves closer to Swing with its concentration on reusable user interface widgets (or components).

MVC Pattern

  We begin by describing the traditional form of MVC and then discuss how it has been adapted for the Web. Each of the three frameworks is then examined, and their respective implementations of this common pattern are uncovered. The intent of this pattern is to partition interactive applications into three separate components: Model, View, and Controller. The Model represents core application data and functional logic, the View renders the data and displays it to users of the application, and the Controller handles user interaction or input. All three components communicate via a change-propagation mechanism to stay synchronized.

Motivation