简体   繁体   中英

Play framework 1.2.4 migration? what to do best?

我想在我的应用程序中添加授权和身份验证,它使用的是Play 1.2.4,更好的是,现在将整个应用程序迁移到2.0或者使用1.2.4的某些模块,以及稍后通过迁移和重新实现身份验证进行斗争?

If you're just looking to implement authentication and authorization, then migrating to Play 2.0 is certainly not required. Besides, migration from 1.x to 2.0 is not that easy, depending on the complexity of your application. There are some quite significant differences between the two major versions of the framework. Reimplementing authentication later will not be the biggest of your worries should you embark on a migration mission.

For Play 1.2.4 authorization, I can recommend the Deadbolt module , it is very flexible yet easy to start working with. For authentication, the basic secure module can be extended to cover most needs.

I just recently had to roll out auth for a Play 1.2.4 site and it was fairly painless using Play-ScalaSecure . Might not be that helpful if you not using Scala. . .

The downside is the docs are pretty sparse, but setting up was easy and implementation is simple. Just apply the Secure trait to controllers.

I have evaulated migration of my 1.2.4 application, which is currently in development and is soon to be released for the first time, to version 2.0 just yesterday and it was not a hard decision to stay with 1.2.4 version. Playframework 2.0 is a VERY different framwork than 1.2.4, at least from my point of view:

  • Controllers are different
  • Persistance access layer is different
  • Templating is different
  • Configuration is different
  • etc.

No doubt that my next application will go with Playframework 2.0, but my current target is to do the release for my current application as soon as possible. Migration to 2.0 would slow this target considerably. If you have the same target, then I recommend you to stay with 1.2.4 and use Deadbolt Module as mentioned here already. What I would do, is to quickly learn how things are done in Playframework 2.0 and design new things in your current 1.2.4 application in a way which would make it easy to migrate...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM