毕业设计外文资料翻译-对PHP的MVC框架演变的实证研究_第1页
毕业设计外文资料翻译-对PHP的MVC框架演变的实证研究_第2页
毕业设计外文资料翻译-对PHP的MVC框架演变的实证研究_第3页
毕业设计外文资料翻译-对PHP的MVC框架演变的实证研究_第4页
毕业设计外文资料翻译-对PHP的MVC框架演变的实证研究_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

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

文档简介

1、毕业设计外文资料翻译学 院: 专业班级: 学生姓名: 学 号: 指导教师: 外文出处: Advanced Computer and Communication Engineering Technology 附 件:1.外文资料翻译译文; 2.外文原文 指导教师评语:该英文资料选择合理,与毕业设计论文相关度较高。专业术语、词汇翻译的准确度较高,体现了较强的专业英语应用水平。翻译工作认真细致,严格按照规定,翻译材料基本能与原文能保持一致,能正确表达出原文意思,细节处理得当,保持准确。翻译字、词数满足要求。翻译材料语句较通顺,符合中文的表达习惯。翻译工作能够严格按照规定,达到考核、提高学生英语应用水

2、平的目的,圆满完成要求。签名: 年 月 日1外文资料翻译译文对PHP的MVC框架演变的实证研究摘要:网络技术的贸易,社会和教育的重要性已经极大的提高在网络编程脚本方面的研究。关于编写PHP解码的几个方法,例如:面向对象程编程(简称:OOP),PHP编码程序和模型视图控制器(简称:MVC)模式已经被提出。模型视图控制器(简称:MVC),发展PHP应用最重要的方法之一,有许多变形,例如:Laravel, Symfony, CodeIgniter, CakePHP等等。然而,在变形之中对于MVC框架最好的选择与程序设计者和项目经理密切相关,特别是当解决重大应用问题时。因此,需要性能评价准则。这篇文章

3、讨论MVC,基于最著名的PHP框架,评估它们的性能,并且发现Laravel执行其他MVC框架。因此,Laravel被提出是在未来网络技术最适用于PHP框架的技术。简介基于应用的网络,互联网的迅速发展显示着对解码方法的可信度,可测量性,安全性以及可维护性的更高的需求。PHP,是一个使得动态互动网络发展的编译程序,例如:使用简便的编译快捷,跨平台,开放资源,灵活性和所需的最小安装程序。这变成最重要的网络发展语言之一,因此,PHP是网络世界中最有力的程序设计语言。几个发展者选择有效地利用基于PHP的应用,将所有的问题,例如:数据存取,业务逻辑以及数据显示层都揉合在一起。这样相应的创造了发展问题,特别

4、是对于大的工程项目。为了解决这些问题,MVC设计模式带来了最有效的方式,从对方根据每层活动层独立编码。MVC设计模式被证实是发展应用程序,例如:CakePHP, CodeIgniter, Laravel, Symfony的最有效方法。MVC最主要的方式是分离应用到各个层面,这样可以独立运行,并且产生同样的效果。使用MVC模式的优势:标准性,连续性和可预测性;软件组件或者结构构建以便于发展者可分享和重新使用解码;一个模型和体系结构可允许整个系统如何工作的简单可视化;可在文库,教室里的重新使用和彻底检测的解码作用;结构良好的解码可适用于体系结构模式;安全性,互用性和可维持性;尽管基于框架结构的MV

5、C(CakePHP, Laravel, CodeIgniter)有许多优点,但是,对于最好的PHP框架的选择仍是一个忧虑。这是因为所有的框架不会覆盖网络应用的所有层面。这个学习研究评估最著名的PHP框架是基于MVC设计模型,并且它的执行以及为未来网络发展提出最有效的PHP,MVC框架。材料和方法模型视图控制器(简称:MVC)的操作方法是分离或者拆分不同部分的解码变成不同的层次,例如:视图,数据存取,控制使用者需求以及提出对相关层面的要求。 MVC模式的称谓对三个核心部分的总结:模型,视图,控制器。一个完整的,正确的MVC模式的视觉表现类似于下面的图形。模型模型这个称谓得名于使用在整体设计时数据

6、的长期储存。它必须允许数据被查看,被收集和被编写的权利,并且它在整体模式中充当着视图部分和控制器部分的桥梁作用。模型最重要的一个部分在于它是技术上的文盲因为这样,模型在当它被传送给视图或者是控制器的时候,它对于数据发生了什么是没有联系或者是了解的。它从不命令或从其他部分寻找回复,它最主要的目的是处理数据而使之能长期储存,以及准备数据能被传送到另外的部分。模型不能被简单的认定为数据处理基础工具,或者是看成处理数据的另一个系统的入口。模型是数据自身的一个看管者,不问任何问题,只接受所有要使用到它的需求。常常在MVC系统里这种最复杂的部分,模型部分也是整个系统的顶峰,如果没有它,在控制器与视图之间也

7、不会有任何联系。视图视图是一个数据的功能区,它是模型层数据的输出展示。传统意义上,为了发展而在网络应用中使用MVC。视图是系统的一个组成部分,在其中产生并显示出了HTML。视图也引发了使用者们的反响,他们在控制器中互动交流。这个最基础的例子是由视图产生的按钮,可以让使用者在控制器中单击并触发一个行动。关于视图的错误认识这里列举出几个关于视图部分的错误认识,尤其是被网络发展者应用在MVC模式中去构建他们的应用。比如,许多人误认为视图与模型之间没有任何的联系,以及所有由视图所显示的数据都是传送给控制器。事实上,这种言论与MVC模式背后的理论是完全相悖的。Fabio Cevascos的文章,Cake

8、PHP框架:你的第一错误印象证实了在CakePHP框架中这种存在疑惑性的方式。为了正确应用MVC结构,在视图与模型之间必须不存在任何的相互影响:所有的操作规则都由控制器制定。进一步来说,把对于视图的表述看成是一个模版文件是不准确的。视图确实不仅仅是一个模版,MVC框架的现代启发已经几乎退化成一种观念,没有人真正的关心一个框架是否能真正的坚持正确的MVC模式。对于提及视图部分从没有由控制器而被迫传输数据也是很重要的。如果在视图与控制器之间不存在模型,那么这两者是没有直接的联系的。控制器三个组成部分中的第三个部分是控制器。它的工作是处理使用者所传送的数据,以及相应地更新模型。控制器可以被总结成是一

9、个信息收集员,然后它将信息传送给模型储存,并且不包含任何操作规则,不同于收集使用者的输入信息。控制器也仅被连接在一个独立的视图和模型上,使之只有一个数据传送系统,并且在数据交换的每一个点都有确定的程序。当使用者首先与视图进行交流时,控制器就会被授予任务去执行,并且每一个控制器都能起到触发器的作用,在使用者与视图交流时而被设置。发展者所犯的最普遍的错误是,把控制器误认为是一个入口,并且最终指定视图应该做履行的作用和责任。另外,有一个普遍错误是去指定控制器的作用是大量处理信息,传送和处理从模型到视图的数据。尽管如此,MVC模式关系应该在模型与视图之间被维持。CodeIgniterCodeIgnit

10、er是一个开放型资源高速发展的网络应用框架,为的是与PHP一同构建动态网络。它的目标是能够比Scratch编写的解码更加快速的发展专题项目。通过为普遍所需的任务提供大量的文库和简单的界面以及逻辑结构去进入这些文库。CodeIgniter第一个公共的版本在2006年,2月28日被发布。最新的稳定版本2.1.4在2013年7月8日被发布。CodeIgniter大致是被基于通俗化的模型视图控制器发展模式。然而发展CodeIgniter视图与控制器是一个必要的组成部分,模型是可以选择的。当与其他PHP框架相比,CodeIgniter的速度是引人注目的。CakePHPCakePHP是一个开放型资源网络应

11、用框架。它接受模型视图控制器(简称:MVC)方式以及被编程进PHP。CakePHP使用最著名的微软工程概念和微软设计模式。SymfonySymfony是MVC应用程序的一个PHP网络应用框架。Symfony是一个免费的微软程序,并且在MIT协议下被发布。The 在2005年10月18日被运行。LaravelLaravel是一个PHP免费开放资源网络应用结构,这个设计是为了MVC网络应用的发展。Laravel是在MIT协议下被发布。Benchmarking为了评估所涉及到的四个PHP框架(CodeIgniter(简称:CI), Symfony, CakePHP 和Laravel)的运行。实施Be

12、nchmarking的最有效方法是通过制定几个准则,例如:每秒所需,平均系统负荷,使用内存和每个MVC所需的大量文件。为了评估这四个框架,网络设计包含hello word在APACHE中被执行,这是每个评估准则下的结果。每秒所需(Request per Second) 这种Benchmarking是基于APACHE。数字图40.2展示了在四个MVC(CodeIgniter(简称:CI), Symfony, CakePHP 和Laravel)中的不同运行。可以看到的是,在所需人数上,Laravel比其他的几个MVC的数量要多。相比于其他几个,它可以每秒处理3000个需求。在这种情况下,因此,更大

13、的输出暗示着更好的结果,以及暗示着最好的执行效果。平均系统负荷(System Average Load)平均系统负荷是与时间有关的测量方式,那就是,在一分钟内当Apache Benchmark完成后,在这种情况下,最小是最好的。数字图40.3展示了一分钟内四个MVC在系统负荷方面的比较。在这个图表内,Laravel用了最少的时间。基于平均时间,最少的平均时间能够更好的运行MVC应用。结论一个围绕PHP框架,以MVC模式为主的实验性研究在本论文中被评估。这些结果从评估四个框架(CodeIgniter(简称:CI), Symfony, CakePHP 和Laravel)中得出,并且在每个框架中使用

14、了每秒所需,平均系统负荷,内存使用,大量所需文件和可以利用的设备。它显示出Laravel优于其他的MVC框架。相比于,其他的像CakePHP平均每秒只能读取750个需要,而Laravel可以平均每秒读取高达3000个所需。这个结果的得出,来自于其他所有的决定性因素,例如:储存,大量的文件,反应时间等等,暗示着Laravel有着网络应用发展的巨大灵活性。对于编程人员来说,它拥有更多的设备。在不同的准则(如:开放资源,灵活性)下,它对于所有的网络编程人员来说都是易于获得的。它提供简单的程序迁移,丰富的文库,模版系统,有说服力的ORM源代码以及广范围的联合支持,这些可以帮助顺利地发展应用。Larav

15、el所有的准则和设备都证明,基于网络应用而有效地发展下一代PHP,Laravel将是所有选择之中的最佳选择。2.外文原文An Empirical Study of the Evolution of PHP MVC FrameworkRashidahF.Olanrewaju, ThouhedulIslamandN.AliAbstract Commercial, social and educational importance of web technology has tremendously increased research activities in web programming/s

16、cripting. Several methods for writing PHP codes such as Object Oriented Programming (OOP), Procedural PHP coding and Model View Controller (MVC) pattern have been proposed. Model View Controller (MVC) which is one of the most powerful method for developing PHP application has many variant such Larav

17、el, Symfony, CodeIgniter, CakePHP etc. However, selection of best MVC framework among the variants is of concern to the programmers as well as project managers, espe- cially when managing big applications. Hence, performance evaluation criterions are required. This paper discusses the MVC based most

18、 famous PHP frameworks, evaluate their performance and it was found that Laravel outperforms other MVC framework, hence Laravel is proposed as the most suitable PHP framework for future web technology.40.1 IntroductionThe rapid development of internet for web based application indicates a higher dem

19、and of reliability, scalability, security and maintainability of coding methodology. PHP, a scripting tool for web that enable dynamic interactive web development such intuitive, compiled fast, cross platform, open source, exibility as well as required minimal setup 1. This became one of the importa

20、nt web development language thus, PHP is one of the most powerful programming language in the web world. Several developers choose to deploy application based on PHP putting all the issues such as data access, business logic, and data representation layer together2.This in turn create development pr

21、oblems especiallyfor big projects. To solve this problem, MVC design pattern brings an effective ways to separate code in layers from each other based on each layer activities.MVC design pattern is aproven effective way to develop application such as CakePHP, CodeIgniter, Laravel, Symfony. The main

22、methods of MVC to spilt an application into separate layer that can work separately and produce same result. The advantage of using MVC patternare: Standard, consistency and predictability Software components or building-blocks so that developers can share and reuse code3 A model or standard archite

23、cture that allows easy visualization of how the entire system works4 Reusable and thoroughly tested code in the libraries, classes and functions. Well-structured code using architectural pattern6. Security, interoperability and Maintenance.Although MVC based framework (CakePHP, Laravel, CodeIgniter)

24、 has number of advantages 7, however, selecting of best PHP framework is still a concern. This is because all of the framework does not cover all aspect of web applications. This study evaluate most famous PHP frameworks based on MVC design model and it performance as well as proposed the best efcie

25、nt PHPMVC framework for future web development.40.2 Materials and MethodsThe operation of Model View Controller (MVC) method is to spilt or separate the different parts of code into layers such as view, data access, controlling users requests and forward request to relevant layers 8. The MVC pattern

26、s title is a collation of three core parts: Model, View, and Controller. A visual representation of a complete and correct MVC pattern looks like the following in Fig. .1 ModelThe Model is the name given to the permanent storage of the data used in the overall design. It must allow access for the da

27、ta to be viewed, or collected and written to, and is the bridge between the View component and the Controller component in the overall pattern 9. One important aspect of the Model is that its technically blindby this, the model has no connection or knowledge of what happens to the data when it is pa

28、ssed to the View or Controller components 10. It neither calls nor seeks a response from the other parts of the component; its main purpose is to process data into its permanent storage, seek and prepare data to be passed along to the other parts. The Model cannot simply be assumed as a database too

29、lkit only, or a gateway to another system which handles the data process 11. The Model represents a gatekeeper to the data itself, asking no questions but accept all requests which comes its way. Often this most complex part of the MVC system, the Model component is also the pinnacle of the whole sy

30、stem since without it there will be no connection between the Controller and the View.40.2.2 ViewThe View is a module where data, requested from the Model is viewed and its nal output is determined. Traditionally in web application use MVC for development, the View is the part of the system where th

31、e HTML is generated and displayed. The View also ignites reactions from the user, who then goes on to interact with the Controller. The basic example of this is a button generated by the View, which a user clicks and triggers an action in the Controller. Misconceptions About ViewThere are some misco

32、nceptions held about View components, particularly by web developers using the MVC pattern to build their application. For example, many mistaken the View as having no connection whatsoever to the Model and that all of the data displayed by the View is passed from the Controller. In reality, this ow

33、 disregards the theory behind the MVC pattern completely. Fabio Cevascos article, The CakePHP Framework: Your First Bite 1 demonstrates this confused approach to MVC in the CakePHP framework. In order to correctly apply the MVC architecture, there must be no interaction between models and views: all

34、 the logic is handled by controllers 13. Further- more, the description of Views as a template le is inaccurate. The View is really much more than just a template, the modern MVC inspired frameworks have bastardised the view almost to the point that no one really cares whether or not a framework act

35、ually adheres to the correct MVC pattern or not. Its also important to mention that the View part is never given data by the Controller. There is no direct relationship between the View and the Controller without the Model in between them.40.2.3 ControllerThe third component of the triad is the Cont

36、roller. Its job is to handle data the user submits as well as update the Model accordingly. The Controller can be summed up as a collector of information, which then passes it on to the Model to be organized for storage, and does not contain any logic other than collecting user input 9. The Controll

37、er is also only connected to a single View and to a single Model, making it a one way data ow system, with handshakes and signoffs at each point of data exchange. Controller is only given tasks to perform when the user interacts with the View rst, and that each Controller function is a trigger, set

38、off by the users interaction with the View 14. The most common mistake made by developers is confusing the Controller as a gateway, and ultimately assigning it functions and responsibilities that the View should do (this is normally a result of the same developer confusing the View component as a te

39、mplate).Additionally, its a common mistake to assign the Controller functions that gives it the sole responsibility of crunching, passing, and processing data from the Model to the View. Nonetheless, the MVC pattern relationship should be kept between the Model and the View.40.3.1 CodeIgniterCodeIgn

40、iter is an open source rapid development web application framework, for use in building dynamic websites with PHP. Its goal is to enable to develop projects much faster than writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and l

41、ogical structure to access these libraries. The rst public version of CodeIgniter was released on February 28, 2006, and the latest stable version 2.1.4 was released July 8, 2013 15. CodeIgniter is loosely based on the popular Model-View-Controller develop- ment pattern. While view and controller cl

42、asses are a necessary part of develop- ment under CodeIgniter, models are optional. CodeIgniter is most often noted for its speed when compared to other PHP frameworks.40.3.2 CakePHPCakePHP is an open source web application framework. It follows the Model- View-Controller (MVC) approach and is writt

43、en in PHP, modeled after the con- cepts of Ruby on Rails, and distributed under the MIT License 16. CakePHP uses well-known software engineering concepts and software design patterns, as Convention over conguration, Model-View-Controller, Active Record, Association Data Mapping, and Front Controller

44、.40.3.3 SymfonySymfony is a PHP web application framework for MVC applications. Symfony is free software and released under the MIT license. The website was launched on October 18, 200 LaravelLaravel is a free, open source PHP web application framework, designed for the development of MVC web applic

45、ations. Laravel is released under the MIT license, with its source code hosted on GitHub. The key design points of Laravel are: Bundles provide Laravel with a modular packaging system, and numerous bundled features are already available for easy addition to applications. Eloquent ORM is an advanced

46、PHP implementation of the active record pat- tern, providing internal methods for enforcing constraints to the relationships between database objects 18. Application logic is part of developed applications, either by using controllers, or as part of route declarations. Syntax used for denitions is s

47、imilar to the one used by Sinatra framework. Reverse routing denes a relationship between links and routes, making it possible for later changes to routes to be automatically propagated into relevant links. When links are created by using names of existing routes, appropriate URIs are automatically

48、created by Laravel 19. Restful controllers provide an optional way for separating the logic behind serving HTTP GET and POST requests. Class auto loading provides automated loading of PHP classes, without the need for manual maintenance of inclusion paths. On-demand loading prevents loading of unnec

49、essary components; loaded are only those components which are actually used 20. View composers are logical code units that can be executed when a view is loaded. Migrations provide a version control system for database schemas, making it possible to associate changes in the applications code base an

50、d required changes in the database layout, easing deployment and updating of applications 21. Unit testing plays an important role in Laravel, which itself has a large number of tests for detecting and preventing regressions. Unit tests can be run through the artisan command-line utility 22. Automat

51、ic pagination simplies the task of implementing pagination, replacing the usual manual implementation approaches with automated methods inte- grated into Laravel 23.40.4 BenchmarkingTo evaluate the performance of four mentioned PHP frameworks; CodeIgniter (CI), Symfony, CakePHP and Laravel. The best

52、 way to do the benchmarking is by applying several criteria such as request per second, system load average,memory usage, number of function calls and number of les required on each of the MVC. To evaluate these four frameworks, web design which contains hello word was carried out on apache (ab c 20

53、0 n 50,000), below are results of each evaluation criteria.40.4.1 Request per SecondThis benchmarking is based on apache (ab c 200 n 50,000). Figure 40.2 shows the performance comparison among four MVC: CI, CakePHP symphony and Laravel. It can be seen that Laravel outperforms other MVC in terms of request person. It was able to handle 3,000 request per second compare to others. In this case, bigger output indicates perfect result hence, it denotes bes

温馨提示

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

评论

0/150

提交评论