Play Framework 1.0和2.0之间的主要区别是什么? [英] What are the major differences between Play Framework 1.0 and 2.0?

查看:118
本文介绍了Play Framework 1.0和2.0之间的主要区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在最近发布的Play Framework 2.0中,我想知道是否有人可以从较高的角度总结Play Framework 1和& amp;的主要区别. 2.

我已经编译了一些(播放1.0->播放2.0):

  • 模板引擎:Groovy页面-> Scala模板
  • 持久性:休眠-> Ebean
  • 语言支持:Java-> Scala,Java
  • 动态编译:字节码注入->通过SBT动态编译
  • 构建系统:不适用-> SBT
  • 可扩展性:模块,插件->子项目,插件,SBT插件

还有什么?阿卡?

解决方案

这是我的列表,当然有些重复

  • 破坏了向后兼容性(这是从头开始重写)

  • 使用Scala和Java编程的核心(不要学习Scala进行协作)

  • 模板的标量(但是正在将Groovy模板作为模块来完成,以简化迁移),因此您必须指定每个参数的类型

  • sbt控制台而不是python脚本

  • sbt用于解决依赖关系,而不是内置解决方案(播放依赖项命令)

  • 模块的可用性,显然将需要全部时间来迁移它们...

  • 对于Java,它偏爱ebean代替hibernate(但您可以使用hibernate)

  • 用于scala,带有anorm(但您可以使用其他库)

  • 模块化程度更高,更易于选择其他组件

  • 更多类型安全-在编译时检查视图甚至路由

  • 更好的表现

  • 类型安全支持,它是类型安全堆栈

  • 更少的魔法,没有太多的字节码生成和类似的东西

  • 更标准,(播放项目只是标准sbt项目)

  • 不同的控制器API(更详细,恕我直言),您可以比较 /controllers/Application.java>类似游戏2.0版

  • scala是一等公民,但同样支持java(每个人都有本机API)

  • 热重编译速度较慢(它仍处于测试阶段,希望他们能够解决它)

  • 对scala IDE的支持还不如java成熟(但它发展得很好)

  • 委托给akka的异步支持

  • 更好地为不同类型的数据源做好准备,例如nosql dbs

有关更多信息,请参见播放2.0页面(西班牙语翻译 RC1文档

无论如何,我认为主要区别在于play 1.x试图逃避j2ee的同时构建自己的堆栈,现在它们已成为基于scala,akka,sbt和支持的新的替代堆栈的一部分像类型安全公司这样的公司...

With the recent release of Play Framework 2.0, I would like to know if anyone could summarize ,from a high level standpoint, the major differences between Play Framework 1 & 2.

I already compiled a few (play 1.0 -> play 2.0):

  • Template engine: Groovy Pages -> Scala Templates
  • Persistance: Hibernate -> Ebean
  • Language support: Java -> Scala, Java
  • Dynamic compilation: byte code injection -> dynamic compilation via SBT
  • Build system: n/a -> SBT
  • Extensibility: Modules, Plugins -> SubProjects, Plugins, SBT plugin

What else ? Akka?

解决方案

Here's my list, of course, with some duplications

  • breaks backward compatibility (it's a rewrite from scratch)

  • core programmed in scala vs java (got to learn scala to collaborate)

  • scala for templates (but work is being done on groovy templates as a module, to ease migration), so you have to specify the type of each parameter

  • sbt console instead of python scripts

  • sbt for solving dependencies instead of built-in solution (play dependencies command)

  • modules availability, it will obviously take some time to migrate them all...

  • for java, it favours ebean in place of hibernate (but you'll be able to use hibernate)

  • for scala, comes with anorm (but you'l be able to use other libraries)

  • more modular, easier to pick other components

  • more type safety - views and even routes are checked at compile time

  • better performance

  • typesafe support, it's part of typesafe stack

  • less magic, not so much bytecode generation and similar stuff

  • more standard, (play projects are just standard sbt projects)

  • different controller API (more verbose, IMHO) you can compare a simple play 1.x crud controller with a similar play 2.0 one

  • scala is a first class citizen, but java is equally supported (has native API for each of them)

  • hot recompiling is slower (it's still on beta, let's hope they solve it)

  • scala IDE support is not as mature as java's (but it's evolving nicely)

  • async support delegated to akka

  • better prepared for different kinds of datasources, like nosql dbs

For more info have a look at play 2.0 page (spanish translation available here) and the RC1 documentation

Anyway, I think the main difference is that play 1.x tried to build it's own stack while escaping away from j2ee, now they are part of a new and alternative stack, based on scala, akka, sbt and with the support of a company like typesafe...

这篇关于Play Framework 1.0和2.0之间的主要区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆