This project aims at showing how to structure a play application with the cake pattern.
It was used in a presentation at Ping Conf in 2014:
- video of the presentation: http://www.ustream.tv/recorded/42775808
- slides: https://speakerdeck.com/yanns/structure-a-play-application-with-the-cake-pattern-and-test-it
It was then extended for compile time dependency injection with macwire (or simple class constructors)
This frontend application uses two backend: a micro-service about players and a video streaming app
The cake pattern in progressively introduces in a frontend application, from TBA_01 to TBA_06. The final version is TBA_05_final.
The version with macwire is TBA_macwire.
- start the backends:
cd backends/PlayerService/
./sbt.sh run
in another terminal:
cd backends/VideoService/
./sbt.sh run
- start one frontend, for example the final version:
cd frontend/TBA_05_final/
sbt run
- check the tests with:
sbt test
Some new versions of the frontend application were added after the presentation to explore other ways to structure an application:
- TBA_07 does not use any components nor any dependency injection. The testing is done only with component tests and is explained in a blog post.
- TBA_macwire uses simple constructors to express dependencies and MacWire to "inject" them. It is like a dependency injection at compile time.