문제

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?
도움이 되었습니까?

해결책

On the migration itself:

  • There're plans to migrate the Groovy templates to Play 2 (I believe is work in progress). You can mitigate this is you start using Play 1.x with Scala, as the template system will be the Scala one.
  • Changing from Hibernate to Ebean should be easy unless you use Hibernate-specific extensions.
  • Configuration and some jobs (like @OnApplicationStart) may change, but this should be quite easy to port (just move them around).
  • There will be changes to the way you access routes and assets, which may give you some extra work adapting code/templates.

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.

다른 팁

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.

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top