Download - Play framework 2
![Page 1: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/1.jpg)
1
Play Framework 2Yannick De Turck
16/10/2014
![Page 2: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/2.jpg)
2
Play, just another web framework?
Based on a lightweight, stateless and web-friendly architecture High scalability
Develop in Scala and/or Java
Developer friendly
- Focus on productivity
- Only need a texteditor and browser
- Hit refresh workflow
- Type safety
Open Source
Inspired on Rails and Django
![Page 3: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/3.jpg)
3
Who uses Play?
![Page 4: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/4.jpg)
4
MVC architecture
Model (Java and/or Scala)
Controller (Java and/or Scala)
View (templates, HTML and Scala)
Routes
- Mapping url paths and Controllers
![Page 5: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/5.jpg)
5
Type Safety
Majority of code gets compiled including:
- Templates
- Assets (Coffeescript, LESS)
Detect errors as early as possible
![Page 6: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/6.jpg)
6
Conventions of configurations
Vast structure
A lot of functionalities come with the core bundle
![Page 7: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/7.jpg)
7
build.sbt
![Page 8: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/8.jpg)
8
app/models
![Page 9: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/9.jpg)
9
app/controllers
![Page 10: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/10.jpg)
10
app/views
![Page 11: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/11.jpg)
11
conf/application.config
![Page 12: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/12.jpg)
12
conf/messages
![Page 13: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/13.jpg)
13
conf/routes
![Page 14: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/14.jpg)
14
Hot reloading
Start server once
Make code change
Hit F5 in browser
Change is live!
![Page 15: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/15.jpg)
15
Errors displayed in browser
Compilation and runtime errors are displayed in browser
Go fix and hit F5!
![Page 16: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/16.jpg)
16
Database evolutions
Track your database schema changes
Robust way to update PROD schema
Two sections
- Ups (create, insert,…)
- Downs (drop, delete,…)
Number files (1.sql, 2.sql,…)
Automatically or manually executed
![Page 17: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/17.jpg)
17
Setting up Play
Download at https://www.playframework.com/download
Add to PATH
Verify set up correctly via activator -help
![Page 18: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/18.jpg)
18
Creating a new project
Via terminal/console:
- activator new
- Choose template/seed
- Pick a name
![Page 19: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/19.jpg)
19
Creating a new project
Via UI:
- activator ui
- Pick seed
- Choose locationfor the project
![Page 20: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/20.jpg)
20
Creating a new project
Generate project files for your favourite IDE
- IntelliJ: activator idea
- Eclipse: activator eclipse
Open the project in your favourite IDE
![Page 21: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/21.jpg)
21
Documentation
https://www.playframework.com/documentation
![Page 22: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/22.jpg)
22
Follow tutorials
![Page 23: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/23.jpg)
23
Personal experience
Refreshing and very pleasant to work with
Go with Scala instead of Java
Hot reloading is awesome
Helpful community
Actively being worked on
![Page 24: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/24.jpg)
24
Q&A
![Page 25: Play framework 2](https://reader033.vdocuments.us/reader033/viewer/2022061200/5476d2b1b4af9f247c8b462e/html5/thumbnails/25.jpg)
25
Useful links
https://www.playframework.com
https://groups.google.com/forum/#!forum/play-framework
Presentation available on SlideShare: http://goo.gl/OK65BX