网上订餐外文资料_第1页
网上订餐外文资料_第2页
网上订餐外文资料_第3页
网上订餐外文资料_第4页
网上订餐外文资料_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

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

文档简介

1、毕业设计(论文)外文资料翻译 VCDesignPattern MVC设计模型 常牛力牛名 储淼一 J 1L- 1 专名称 软件工程 y ii n 1 学科门类 工学一 指导老师一 储淼 提交翻译日期 二。一五年一月 MVC Design Pattern MVC设计模型 MVC is a widely popular software desig n patter n, as early as in the 70s, IBM introduced the Sanfron scisico on the project, in fact, is the MVCdesign pattern resea

2、rch.Rece ntly, with the maturity of J2EE, it is becoming a recomme ndati on in the J2EE platform, a desig n model, the majority of Java developers are also very in terested in the desig n model. MVC model is gradually developed in PHPand ColdFusion are in use, and growth trends With the rapid in cre

3、ase in web applicati ons, MVC model for the developme nt of Webapplications is a very advaneed desig n idea, no matter what Ian guage you choose, no matter how complicated the applicati on, it can be for you to un dersta nd and provide the most basic application model an alyticalmethods, structural

4、products for you to provide a clear framework for the design, for your software projects MVC是一种目前广泛流行的软件 设 in accorda nee with norms. 计模式,早在70年代,IBM就推出了 Sanfronscisico项目计划,其实就 是 MVC设计模式的研究。近来,随着J2EE 的成熟,它正在成为在J2EE平台上推荐 的一种设计模型,也是广大Java开发者 非常感兴趣的设计模型。 MVC模式也逐渐在PHP和ColdFusion 开发者中运用,并有增长趋势。随着网 络应用的快速增

5、加,MVC模式对于Web 应用的开发无疑是一种非常先进的设计 思想,无论你选择哪种语言,无论应用 多复杂,它都能为你理解分析应用模型 时提供最基本的分析方法,为你构造产 品提供清晰的设计框架,为你的软件工 程提供规范的依据。 MVC desig n idea MVC inEn glish or Model-View-C on troller,an applicati on that is in put, process, output process in accorda nee with the Model, View, Con troller isolated manner, such a

6、n application is divided into three layers model layer, view layer, con trol layer. View (View) on behalf of the user in terfacefor Web applicati ons can be summed up as HTML in terface, but has the pote ntial to XHTMLXML, and Applet. With the applicati on of the complexity and scale, the in terface

7、 has become challe nging to deal with. An application may have differe nt views, MVC desig n pattern to deal with the view of the limited view of data acquisiti on and processing, as well as the users request, not in eluded in the view on the han dli ng of bus in ess processes. The han dli ng of bus

8、 in ess processes to the model (Model) to deal with. For example, a view only accept orders from the MVC设计思想 MVC 英文即 MbdelViewController,即 把一个应用的输入、处理、输出流程按 照 Model、View、Controller 的方式进 行分离,这样一个应用被分成 三个层一 一模型层、视图层、控制层。 的处理交予模型(Model)处理。比如一个 订单的视图只接受来自模型的数据并显 示给用户,以及将用户界面的输入数据 和请求传递给控制和模型。 视图(View)代表

9、用户交互界面,对 于Web应用来说,可以概括为HTML界 面,但有可能为XHTML XML和 Applet。随着应用的复杂性和规模性,界 面的处理也变得具有挑战性。一个应用 可能有很多不同的视图,MVC设计模式 对于视图的处理仅限于视图上数据的采 集和处理,以及用户的请求,而不包括 在视图上的业务流程的处理。业务流程 no 程的处理过程对其它层来说是黑箱 操 model data and display to users, as well as in put user in terface data and the request passed to the con trol and mode

10、l. Model (Model): is the business process / status of the process ing and bus in essrules.Bus in ess process layer is the other black-box operatio n, the model view to accept the request of the data, and return the results of the fin al. The desig n of bus in ess models can be said to be the most im

11、ports nt core of MVC. Currently popular model of EJB applicati ons is a typical example of the applicati on of tech no logy from the perspective of the model further deli neati on in order to make full use of existi ng comp onen ts, but it can not be used as a framework for application design model.

12、 It only tell you that according to the design of this model will be able to use certa in tech no logy comp onen ts, thereby reduc ingthetech ni cal difficulties.Example of a 模型(Model):就是业务流程/状 态的处理以及业务规则的制定。业务流 develper, you can focus on bus in ess 作,模型接受视图请求的数据,并返回 最终的处理结果。业务模型的设 计可以 说是MVC最主要的核心。目

13、前 流行的 EJB模型就是一个典型的应用例子,它 从应用技术实现的角度对模 型做了进一 步的划分,以便充分利用现有的组件, 但它不能作为应用设计模型的框架。它 仅仅告诉你按这种模 型设计就可以利用 某些技术组件,从 而减少了技术上的困 难。对一个开发 者来说,就可以专注于 业务模型的设 计。MV(设计模式告诉我 们,把应用的模型按一定的规则抽取出 来,抽取的层次很重要,这也是判断开 发人员是否优秀的设计依据。抽象与具 体不能隔得太远,也不能太近。 model desig n. MVC desig n patter n tells us that the applicati on of the

14、model according to certain rules of tak ing away the level of extract ion is very imports nt, which is to determ ine whether the developme nt in accord a nee with good design. Abstract and concrete can not be separated too far, nor too close. MVC model did not provide the desig n method, but only te

15、ll you that the managementf these models should be organized in order to facilitate recon structio n and improve the model reusability. We can make an analogy with object program ming,MVC defi nes a top-level category, the sub-class to tell it you have to do these, but you can not do these restrict

16、ions. This is the developer of the program ming is very importa nt. There is also a bus in ess model of the model is very imports nt that the data model. Data model mainly refers to the object data en tities (con ti nued of).Forexample, an order will be saved to the database MVC并没有提供模型的设计方法, 而只告诉你应该

17、组织管理这些模型,以 便于模型的重构和提高重用性。我们可 以用对象编程来做比喻,MVC定义了一 个顶级类,告诉它的子类你只能做这 些,但没法限制你能做这些。这点对编 程的开发人员非常重要。 业务模型还有一个很重要的模型那 就是数据模型。数据模型主要指实体对 象的数据保存(持续化)。比如将一张订 单保存到数据库,从数据库获 取订单。 我们可以将这个模型单独列出,所有有 关数据库的操作只限制在该模型中。 to obtain orders from the database. Wecan separate this model, all the operatio n of the database

18、is only, limited in terpreted as a request received from the user, match ing the model and view together to complete the users request. The role of divisi on of con trol layer is also very clear that it clearly tell you that it is a distributed, and what kind of model to choose, choose what kind of

19、view, to complete what the user requests. Con trol layer to the model Control (Controller) can be does not do any data processing. For example, the user clicks on a link and control layer to receive arequest, does not deal with business information, only the users information to the model, to tell w

20、hat model to choose the view to meet the requirements to return to the user. Therefore, a model may correspond to multiple views, one view may correspond to a number of models. 局限于模型 控制(Controller)可以理解为从用户 接收请求,将模型与视图匹配在一起,共 同完成用户的请求。划分控 制层的作用也很 明显,它清楚地告诉 你,它就是一个分发 器,选择什么样的模型,选择什么样的视 图,可以完 成什么样的用户请求

21、。控制层并 不做 任何的数据处理。例如,用户点击一 个连接,控制层接受请求后,并不处理业 务信息,它只把用户的信息传递 给模型,告 诉模型做什么,选择符合 要求的视图返回给 用户。因此,一个 模型可能对应多个视图, 一个视图可能对应多个模型。 The benefits of MVC Most of the process of language use such as ASP, PHP developed Web applications, the development of the in itial template is the mixed layer of the dataprogra

22、m ming. For example, send the request directly to the database and display HTML, development speed is often faster, but because of the separatio n of data pages is not very direct, and therefore reflect the bus in ess model difficult to look or model reusability. Very flexible product desig n effort

23、s, it is difficult to meet the cha nging n eeds of users. MVC layered on the application of the requireme nts, although additional work would take, but clearly the structure of products, product applicati on through the model can be better reflected. First of all,the most imports nt thi nq is that t

24、here should be a nu mber of view corresp to the ability of a model. In the curre ntrapidly changing user requirements, it may have access to a wide range of applicati ons. For example, orders 大部分用过程语言比如ASP PHP开 MVC勺优点 发出来的Web应用,初始 的开发模板就是混合层的数据编程。例 如,直接向数据库发送请求并用HTML 显示,开发速度往往比较快,但由于数 据页面的分离不是很直接,因而

25、很难体 现出业务模型的样子或者模型的重用 性。产品设计弹性力度很小,很难满 足 用户的变化性需求。MVC要求对应用 分 层,虽然要花费额外的工作,但产 品的 结构清晰,产品的应用通过模型可以得 到更好地体现。 首先,最重要的是应该有多个视图 对应一个模型的能力。在目前用户需求 的快速变化下,可能有多种方式访问应 用的要求。例如,订单模型可 能有本系 统的订单,也有网上订单,或者其他系 统的订单,但对于订单的处理都是一 样,也就是说订单的处理for the model may be orders of the system as well as online orders, or orders

26、for other systems, but the handling of orders is the same, that is to say the handling of orders is the same. MVC design pattern in accord a nee with a orders for models and multiple views can solve the problem. This reduced the code to copy, that is, a reducti on of the maintenance code, once the m

27、odel changes, but alsoeasy to mai nta in. MVC Desig n Model Secondly, the data returned as a result of the model without any display format, so these models can also be directly applied to the use of in terfaces. Third, as a result of an applicati on to be separated into three, it is sometimes one o

28、f them will be able to change to meet cha nges in the applicatio n. An applicati on of bus in ess processes or bus in ess rules cha nge simply changes the model layer con cept of con trol layer is also very effective, because of its是一致的。按MVC设计 模式,一个订单模型以及多个视图即可 解决问题。这样减少了代码的复制,即 减少了代 码的维护量,一旦模型发生改 变

29、,也易于维护。 MVC设计模型 其次,由于模型返回的数据不带 任 何显示格式,因而这些模型也可直接应 用于接口的使用。 再次,由于一个应用被分离为 三层,因此有时改变其中的一层就能满 足应用的改变。一个应用的业务 流程或 者业务规则的改变只需改动MVC勺模型 它把不同的模型和不同的视图组合在一 起完成不同的请求,因此,控制 层可以 说是包含了用户请求权限的概 念。 最后,它还有利于软件工程化 管理。由于不同的层各司其职,每一层 不同的应用具有某些相同的特 征,有利 于通过工程化、工具化产生管理程序代 码。 d if fere ntmodels and differe nt views toge

30、ther to complete various requests, the con trol layer can be said to be in eluded in the con cept of a user request for permissi on. Fin ally, it is also ben eficial to the management of software each d iff re ntlayer, each layer of differentapplications have some similarcharacteristics,is con duciv

31、e to the adopti onof engineering and management tools of program code gen erated. The shortco mings of MVC 控制层的概念也很有效,由于 Design and implementation of MVCis not very easy, easier to understand, but for developers the requireme nts are relatively high. MVCs just a basic designidea, but also the n eed for careful desig n and pla nnin

温馨提示

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

评论

0/150

提交评论