PLAY_FRAMEWORK_框架_FAQ.docx_第1页
PLAY_FRAMEWORK_框架_FAQ.docx_第2页
PLAY_FRAMEWORK_框架_FAQ.docx_第3页
PLAY_FRAMEWORK_框架_FAQ.docx_第4页
PLAY_FRAMEWORK_框架_FAQ.docx_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

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

文档简介

公司名称:宁波市鄞州亿赛德信息科技有限公司公司地址:宁波市天童北路933号和邦大厦A座209公司总机司网址:经常被问到的问题Frequently Asked QuestionsPlay和其他的框架相比怎么样How does Play compare to framework X?现在,在开发web应用方面,你有很多的选择。Play作为一个Java Web应用开发框架,让我们和其他Java框架比较一下。Play的实现为“无共享”架构(也可以认为是无状态框架),所以它和其他有状态和已组件为基础的框架(如Seam, Tapestry or Wicket等)完全不同,它和Spring MVC or Struts (or Struts 2)比较像,但是更加坚定.Nowadays, you have a very large number of choices for developing web applications. Play being a Java web application framework, lets compare it to other Java frameworks. Play is built for a share nothing architecture (think about it as a stateless framework), so its very different from all these Java stateful and components based frameworks like Seam, Tapestry or Wicket. Its closer to Spring MVC or Struts (or Struts 2), but way more opinionated.但是Play是一个独一无二的Java框架,它不依赖与所谓的Java企业标准,它使用的是Java,但是它试着把其他基于脚本语言的框架如 Ruby On Rails, Django, Pylons, Symfony, Grails and Cake PHP中好的想法带到Java世界中。我们真的试着从Java平台中得到更好的,而不是像传统的Java web开发中那样令人叫苦连连,太多的抽象,太多的配置文件。However Play is a unique Java framework. It does not really rely on the so-called Java Enterprise standards. It uses Java, but tries to bring all the good things from the frameworks based on scripting languages like Ruby On Rails, Django, Pylons, Symfony, Grails and Cake PHP to the Java world. We really tried to get the best out of the Java platform without getting the pain of traditional Java web development: a slow development cycle, too much abstraction and too much configuration.你为什么不把play重命名为org.playframeworkWhy dont you rename the play package to org.playframework?!你误解了。Play不是另外一个你需要添加到Servlet容器中的一个类库,它是一个可以独立运行你的应用的全栈式Java框架。Java的包机制的命名约定是防止你使用不同的类库时的名字冲突。相信我,你永远不需要把play.jar库放到你自己的项目中。那不是Play的运行方式,Play是一个平台,不要担心它。You are missing the point. Play is not another library that you add to your Servlet container. Its really a full stack Java framework that runs your application stand-alone. The Java package naming conventions exist to avoid name clashes when you use several different libraries from several vendors. But believe us, you will never put the *play.jar* library in your own project. This is not the way Play works. Play *is the platform*. Dont worry about that.为什么我需要Python(我更喜欢Maven)?Why do I need Python (I would prefer Maven)?我们需要很多脚本区管理Play的应用,去创建一个项目,运行它,打开浏览器等等,当然我们可以直接用Java写。但是用Java VM去运行像创建一个项目这样简单的任务太慢了,而且Java本身同操作系统交互时有很多的限制。We need a lot of scripts to manage Play applications, for creating a new application, running it, launching a browser, etc Of course we could write these in Java directly. But running a Java VM for simple tasks like project creation is very slow. And Java itself is very limited when it comes to OS interaction.Python允许我们写这些脚本,而且是完全可移植的,它运行速度很快,很容易编写,可以在大多数的系统上运行,Windows上没有内置的python,所以我们在框架中绑定了一个Windows上的Python二进制发布包。Python allowed us to write these scripts in a completely portable way. Its fast to run, easy to write and available out of the box on most systems. Its not on Windows, thats why we bundle a Windows Python binary with the framework.Play是一个Groovy框架吗?Is Play a Groovy framework?虽然我们使用Groovy在Play模板系统中作为基本的技术,但是它是绝对透明的。而且,你不能直接在应用的其他任何地方(例如控制器,模型和其他功能中)使用Groovy,如果你在寻找一个基于Groovy的框架,你应该看一下Grails。No. Even though we use Groovy as the base technology for the Play templating system, its totally transparent. Also, you cant directly write any other part of the application (such as controllers, models or other utilities) in Groovy. If youre looking for a Groovy based framework you should have a look at Grails.你们这些家伙甚至不知道怎么用Java写程序。You guys dont even know how to program in Java.我们充分的认识到了我们在Java世界中做了非常不寻常的选择,而且Play盲目的追随那些所谓的Java“最佳实践”。但是所有的Play小组成员都是非常有经验的Java开发者,而且我们非常了解我们所做的选择和打破的规则。We are fully aware that we made choices that are pretty uncommon in the Java world, and that Play does not blindly follow all the so-called Java good practices. But all of the Play team members are very experienced Java developers and we are totally aware of the choices we made and the rules we broke.Java本身是一个非常通用的编程语言,而且不是原生为web应用开发所设计的。去写一个通用的和可重用的库与创建一个web应用是非常不同的。一 个web应用本身不需要去设计成可重用的,你需要更少的抽象,更少的配置。可重用存在在web应用中,但是是通过web service APIs,而不是语言方面的集成。Java itself is a very generic programming language and not originally designed for web application development. It is a very different thing to write a generic and reusable Java library and to create a web application. A web application itself doesnt need to be designed to be reusable. You need less abstraction, less configuration. Reusability does exist for web applications, but through web service APIs rather than language-level integration.当开发实践趋近于零,你就可以把中心放到应用的功能模块上,然后快速的实验,而不是去把功能开发抽象化。When the development time tends to zero you can concentrate on your application features and experiment quickly, instead of trying to abstract things for future developments.Play速度快吗?Is Play fast?是的,Play本身很快。但是不意味着任何特殊的应用都很快。嵌入的HTTP服务器,基础的路由和控制器调用堆栈都非常非常快。使用现代的JVM和即时编译技术你可以很容易处理每秒钟上千次请求。不幸的是,如果你的应用使用了数据库,那么那将像通常那样成为瓶颈。Yes, Play itself is fast. But that doesnt mean that any particular application will be fast. The embedded HTTP server, the basic routing and the controller invocation stack are very very fast. Used with a modern JVM and Just In Time compiling you can easily get thousands of requests per second. Unfortunately, your application will likely use a database, which will become the bottleneck as usual.在Play的堆栈中最占内存的是基于Groovy的模板引擎,但是play的应用时可以很容易扩展的,它并不是一个真正的问题,如果你需要很高的并发量,可以在多个服务器中做负载均衡。我们希望在新的JDK7中得到性能提升,因为它对动态语言有更好的支持。The biggest CPU consumer in the Play stack at the moment is the Groovy-based template engine. But as Play applications are easily scalable, it is not really a problem if you need to handle very high traffic: you can balance the load between several servers. We also hope for a performance gain at this level with the new JDK7 and its better support for dynamic languages.我可以把Play用于生产环境中吗?Can I already use Play for a production application?可以,已经有很多人/community/testimonials 把PLay用于生产环境中去了,现在的1.0分支是一个维护分支,意味着我们只是BUG修改和保持API兼容。Sure, a lot of people:/community/testimonials already use Play in production. The 1.0 branch is now in maintenance mode, which means that we will just fix bugs and keep API compatibility in that branch.其他的类库Play支持吗?Is library X supported?Play使用的是标准的Java,意味着任何基于标准Java的类库都可以很容易的被使用,但是一定要记得Play没有使用 Servlet API(虽然你可以用WAR包导出功能,让它在标准的Servlet容器中工作),所以除非你需要的类库中使用了Servlet API,否则它不会有任何问题。Play is standard Java, so any standard Java library can easily be used. However keep in mind that Play does not use the Servlet API (although you can get it work in a standard Servlet container using the WAR export feature). So unless the library you want to use relies on the Servlet API, there wont be any problem.我怎么帮助你们或者怎样参与贡献How can I help/contribute?我们使用“

温馨提示

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

评论

0/150

提交评论