5

Keeping the notion of a SOA in mind, my intent is to provide several different services, which leverage the same data model. Imagine a poker application - we may have the following services:

  • Game frontend
  • Administrative frontend
  • Player rank / leaderboard service
  • Player finances service
  • Bank integration service
  • ...

All of these services can leverage the same model (perhaps providing additional model information where neccessary).

In the Play! framework, is it possible for me to externalize this data model, but maintain the benefits we gain from using Play. For example, runtime re-compilation.

Modules seem like they might serve the job, but there is little documentation about them, and the examples given suggest the opposite paradigm - where services are the modules, and the core play application pulls in features.

Any guidance would be appreciated.

idbentley
  • 4,188
  • 3
  • 34
  • 50

2 Answers2

3

It's hard to get a true SOA style using Play. Because Play is not just a framework - it's a web platform providing services right from HTTPRequest to Database persistence and not in isolation.

In your case, if you have to truly externalize data-layer- then I would suggest you try Spring module. Spring should take care of Persistence, business logic and encapsulate this in Service Interfaces.

In your Play app, the controller depends on these exposed Service Interfaces. Spring services should be in-dependent on any Play features (be it for validation or JPA persistence etc. i.e. no imports)

The objective is - tommo if required, you should be able to use any MVC framework (Spring MVC, Struts etc) and utilize the same services.

basav
  • 1,453
  • 10
  • 18
0

I'm attempting something similar.

What I am about to attempt is

  • write DAL in a module
  • write each separate component as a separate module.
  • in the future, each component can be hosted in a separate app. Just move the app, install the DAL module and you're all set. This hopefully will cover any scalability stuff.

Theoretically I should be able to call play commands by configuring the build commands in Eclipse so this should allow me to automatically build the modules for the main app to use.

Hopefully this will work for me...

Daryl Teo
  • 5,394
  • 1
  • 31
  • 37