KEMBAR78
Scala play-framework | PDF
Scala Play Framework
Abdhesh Kumar
Associate Software Consultant
Sears Global Technology
What is Play Framework?
● The High Velocity Web Framework For Java and Scala
● Play is based on a lightweight, stateless, web-friendly architecture.
● Built on Akka, Play provides predictable and minimal resource
consumption (CPU, memory, threads) for highly-scalable applications.
Scale predictably
❖ Stateless Web Tier
❖ Non-blocking I/O
❖ Built on Akka
❖ Real-time enabled
Modern web & mobile
❖ RESTful by default
❖ Asset Compiler for CoffeeScript, LESS, etc
❖ JSON is a first class citizen
❖ Websockets, Comet, EventSource
❖ Extensive NoSQL & Big Data Support
❏ Declarative application URL scheme configuration
❏ Type-safe mapping from HTTP to an idiomatic Scala API
❏ Type-safe template syntax
❏ Architecture that embraces HTML5 client technologies
❏ Live code changes when you reload the page in your web browser
❏ Full-stack web framework features, including persistence, security, and
internationalization
Key features
Play framework stack
The application’s model-view-controller structure
1. Download the latest Typesafe Activator.
2. Extract the archive on a location where you have write access.
3. Change dir with cmd cd activator*
4. Add Executables to Path
5. On Unix, use export PATH=/path/to/activator:$PATH
6. On Windows, add ;C:pathtoactivator to your PATH environment variable.
Getting Play and setting up the Play environment
1. activator new my-first-app play-scala
2. cd my-first-app
3. activator run
4. http://localhost:9000 - access your application here.
5. You are now ready to work with Play!
Creating Play Application
Anatomy of a Play application
Play routes HTTP requests to action methods
Routing syntax
Requests Mappings
Controller
Model
View
References
Official Documentation https://www.playframework.com/
Scala play-framework

Scala play-framework

  • 1.
    Scala Play Framework AbdheshKumar Associate Software Consultant Sears Global Technology
  • 2.
    What is PlayFramework? ● The High Velocity Web Framework For Java and Scala ● Play is based on a lightweight, stateless, web-friendly architecture. ● Built on Akka, Play provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.
  • 3.
    Scale predictably ❖ StatelessWeb Tier ❖ Non-blocking I/O ❖ Built on Akka ❖ Real-time enabled
  • 4.
    Modern web &mobile ❖ RESTful by default ❖ Asset Compiler for CoffeeScript, LESS, etc ❖ JSON is a first class citizen ❖ Websockets, Comet, EventSource ❖ Extensive NoSQL & Big Data Support
  • 5.
    ❏ Declarative applicationURL scheme configuration ❏ Type-safe mapping from HTTP to an idiomatic Scala API ❏ Type-safe template syntax ❏ Architecture that embraces HTML5 client technologies ❏ Live code changes when you reload the page in your web browser ❏ Full-stack web framework features, including persistence, security, and internationalization Key features
  • 6.
  • 7.
  • 9.
    1. Download thelatest Typesafe Activator. 2. Extract the archive on a location where you have write access. 3. Change dir with cmd cd activator* 4. Add Executables to Path 5. On Unix, use export PATH=/path/to/activator:$PATH 6. On Windows, add ;C:pathtoactivator to your PATH environment variable. Getting Play and setting up the Play environment
  • 10.
    1. activator newmy-first-app play-scala 2. cd my-first-app 3. activator run 4. http://localhost:9000 - access your application here. 5. You are now ready to work with Play! Creating Play Application
  • 11.
    Anatomy of aPlay application
  • 12.
    Play routes HTTPrequests to action methods
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.