Steve Chaloner, a Brit living in Belgium, has been developing in Java since 1996, and has been an avid user of the Play framework since 2010. Steve has introduced Play into several companies for projects ranging from the fairly small to the extremely large. He is the author of several Play modules, including the Deadbolt authorization system. Steve is a DZone MVB and is not an employee of DZone and has posted 18 posts at DZone. You can read more from them at their website. View Full User Profile

The All-New Play Module Repository

04.10.2012
| 2851 views |
  • submit to reddit

Back in November, I spoke to Nicolas Leroux of the Play framework about creating a module repository. He agreed it would be a good idea, but lack of time has prevented me from starting this. Following the stormy events of last week in the Play Google Group, I’ve decided to prioritise it. A working prototype should be available in a couple of weeks.

The overview:
1. It’s open source
Obviously

2. It’s written in Play 2
Just to piss off the nay-sayers :)

3. Module creation
At the moment, to get a module into the module repository you have to get authorisation from a member of the Play team. I want to have a repo where you can upload any module, as long as it conforms to certain minimum requirements. These are
* a README file
* a license (preferably, but not constrained to, a business-friendly one)
* actual code, to prevent a bunch of empty modules being created

4. Open accounts
Users can create accounts by logging in via twitter, facebook, etc, and link multiple sign-in methods to their accounts.

5. Security
Authentication will come via SecureSocial (so Jorge Aliss needs to start coding!) and authorisation will be implemented in Deadbolt 2. As a result, this will supercede the SociallySecure example app which showed how to integrate the two.

6. Modules are web-accessible
Modules can be downloaded directly through the browser

7. Modules are framework-accessible
Regardless of the version of Play, and therefore regardless of the dependency mechansim, the repository will serve modules directly to the framework. In other words, when you add modules to dependencies.yml or Build.scala, those modules will be fetched by the framework. Manual installation is not required.

8. Voting
Any logged-in user can vote up a module. One vote per module, to keep things fair.

9. Commenting
Any logged-in user can comment. Because of the open sign-in method, I think it doesn’t make sense to have anonymous comments. Trolls can go elsewhere.

10. Play 1 modules
Play 1 modules will be hosted directly in the repo.

11. Play 2 modules
Play 2 modules can also be hosted in the repo, but since they can also be hosted in any Maven or Ivy repo it’s possible to link to the remote repo instead. This doesn’t impact point #7 since it will be transparent to the framework itself.

12. No ambiguity
One very important point comes from Ben Verbeken – “We’ll just have to make sure it’s really obvious to the visitor that they are browsing either the play 1 or play 2 modules (no hidden filter feature, but a big red switch at the top e.g. ;) )”

The github repository (which is currently empty, because it was created nine minutes ago) can be found at https://github.com/playframework/modules.playframework.org

At the moment, we’re purely at the planning stage but I plan to use my favourite development style (evolutionary prototying) to get something up and working fast. The github repo will be created tonight, and regular updates will be posted here.

Peter Hilton has posted some more details over at the Play Google Group.

Published at DZone with permission of Steve Chaloner, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)