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

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

问题描述

随着最近发布的 Play Framework 2.0,我想知道是否有人可以从高层次的角度总结 Play Framework 1 和 Play Framework 1 之间的主要区别.2.

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.

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

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

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

还有什么?阿卡?

推荐答案

这是我的清单,当然,有一些重复

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

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

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

使用 Scala 与 Java 编写的核心(必须学习 Scala 以进行协作)

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

scala 用于模板(但工作正在将 groovy 模板作为模块完成,以简化迁移),因此您必须指定每个参数的类型

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 控制台代替 python 脚本

sbt console instead of python scripts

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

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

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

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

对于 Java,它倾向于使用 ebean 代替 hibernate(但您将能够使用 hibernate)

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

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

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

更好的性能

类型安全支持,它是类型安全堆栈的一部分

typesafe support, it's part of typesafe stack

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

less magic, not so much bytecode generation and similar stuff

更标准,(玩项目只是标准的sbt项目)

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

不同的控制器 API(更详细,恕我直言)你可以比较一个 简单的 1.x crud 控制器 带有 类似play 2.0一个

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

scala 是一等公民,但同样支持 java(每个都有原生 API)

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 支持不如 java 成熟(但它发展得很好)

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

异步支持委托给 akka

async support delegated to akka

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

better prepared for different kinds of datasources, like nosql dbs

有关更多信息,请查看 play 2.0 页面(提供西班牙语翻译 此处) 和 RC1 文档

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

无论如何,我认为主要的区别在于 play 1.x 试图在摆脱 j2ee 的同时构建自己的堆栈,现在它们是新的替代堆栈的一部分,基于 scala、akka、sbt 并得到支持像 typesafe 这样的公司...

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天全站免登陆