今日提供的更轻松迁移至 Play 2 的选项
我是 Scala 和 Play 的新手,我正在考虑将它们用于新项目。 我看到 Play 2 的开发进展顺利,尽管稳定版本仍然是 1.x。并且存在实质性差异< /a> 介于两者之间。
我想知道的是,如果我现在开始一个 Play 1.x 项目,我可以采取哪些选项来方便将来迁移到 Play 2?
即:
- Play 2 使用 Ebean 作为默认 ORM,您建议我使用它来代替 Play 1.x 的 ORM (Hibernate) 吗?
- 模板系统怎么样?我现在可以做些什么来让以后更容易迁移?
- 当我决定将来将我的应用程序移植到 Play 2 时,我还需要担心什么?
I'm new to Scala and to Play, and I'm considering using them for a new project.
I see the development on Play 2 is coming along nicely, although the stable version is still 1.x. And there are substantial differences between the two.
What I'm wondering is, if I start a Play 1.x project now, what options can I take that will ease migration to Play 2 in the future?
Namely:
- Play 2 uses Ebean as the default ORM, would you advise me to use it instead of Play 1.x's ORM (Hibernate)?
- What about the template system; anything I can do now to make it easier to migrate later on?
- What else will I have to worry about when I decide to port my app to Play 2 in the future?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
关于迁移本身:
一般来说,它不应该太复杂,但正如@lacy所说,这取决于你的截止日期和项目本身。如果这是一个关键项目,要在 2012 年 3 月之前完成,我会选择 Play 1.x。如果它是一个不太重要的项目,可能会被推迟,并且无论如何都不会在 2012 年 3 月之前发布,请尝试 Play 2.0。
On the migration itself:
In general it shouldn't be too complex, but as @lacy said, it depends on your deadlines and the project itself. If it's a critical project, to be finished before next March 2012, I would go with Play 1.x. If it's a less important project, which could be delayed, and that in any case won't be released before March 2012, try Play 2.0.
目前我什至都懒得在项目中使用 Play2。它仍然缺乏一些功能,即使开发继续进行,我也会坚持使用 Play 1.2.x。即使我不得不承认尝试 2.0 很诱人。
但我永远不会选择中间的解决方案。从 Play 1.2.x 开始并尝试迁移到 2.0.0。它称为语义版本控制。当主数增加时,没有向后兼容性。这意味着,您可以使用 play 1.2.x 或 Play 2.0。尝试迁移会给你带来比你想要的更多的压力和问题。
I wouldn't even bother using Play2 on project for the moment. It still lacks some features and even if the development is going forward, I would stick with Play 1.2.x. Even if I have to admit it is tempting to try 2.0.
But I would never chose the in between solution, though. Starting in Play 1.2.x and trying to migrate toward 2.0.0. It is called Semantic Versionning. When the major number increases, there is no backward-compatibility. Meaning, you either use play 1.2.x or Play 2.0. Trying to migrate is going to cause you more stress, problems then you want to.
这一切都与您的项目截止日期有关。 Play2 即将推出,一些组件看起来已经相当稳定。所以,如果时间允许,我推荐你使用Play2。它最近已将状态更改为 Beta。几天前,Guillaume 在 Github 上创建了一个有用的 wiki。您还可以关注 Play2 源码中的示例。而且,据我了解,从 Play1X 到 Play2 不会有任何迁移指南。
This' all about your project's deadlines. Play2 is coming soon and some components already seem quite stable. So, if time allows, I would recommend you to use Play2. It recently has changed status to Beta. Several days ago Guillaume created a useful wiki on Github. You can also pay attention to the examples in the Play2 sources. And, as I understand, there will be no migration guidelines from Play1X to Play2.