Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one create a Play Module?

The Play framework documentation is kind of weak when it comes to module creation.

  • How does one creates a Module ?
  • I've read that large applications could be split across several modules, how ?
  • What can/can't be done with a module ? (any access to low level api ?)
  • Can a play module expose abstract JPA classes ?
  • What's the best way to package a module ?
  • How to deploy/distribute a play module ?

I think you get the idea... tell us all about Modules using the Playframework.

like image 818
Olivier Refalo Avatar asked Nov 08 '10 00:11

Olivier Refalo


People also ask

Which component is responsible for building play framework?

Play Framework is an open-source web application framework which follows the model–view–controller (MVC) architectural pattern. It is written in Scala and usable from other programming languages that are compiled to JVM bytecode, e.g. Java.

What is play in programming?

The goal of Play is to be a general purpose programming language which focuses on immutability and controlled side effects. Factor favors mutable data structures.


1 Answers

  • How does one creates a Module ?

play new-module

  • I've read that large applications could be split across several modules, how ?

Well you put components which functionality, for example security or user-management in a module. This module will be referred by you app.

  • What can/can't be done with a module ? (any access to low level api ?)

There are no special things that can be done with a module, with can't be done in your app directly. So if you need a special feature only in 1 app you can program it there directly.

  • Can a play module expose abstract JPA classes ?

There are no limits, you can declare there abstract-classes. Same as in a library.

  • What's the best way to package a module ?

play build-module

  • How to deploy/distribute a play module?

I mean in the discussion group there was plugin which enables you to run a private repository. If it was from general interest and you want to contribute it the whole community register it as a playframework.org, see the guide.

[UPDATE] I copied some information about the src-folder from google-group. The src-folder is for static utility-classes which are not play-specific and Play plugin. They will compiled as jars and put into the lib directory.

Niels

like image 85
niels Avatar answered Sep 20 '22 01:09

niels