play framework 2

25
1 Play Framework 2 Yannick De Turck 16/10/2014

Upload: yannick-de-turck

Post on 27-Nov-2014

80 views

Category:

Software


2 download

DESCRIPTION

The JOIN Event presentation about Play Framework 2.

TRANSCRIPT

Page 1: Play framework 2

1

Play Framework 2Yannick De Turck

16/10/2014

Page 2: Play framework 2

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

3

Who uses Play?

Page 4: Play framework 2

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

5

Type Safety

Majority of code gets compiled including:

- Templates

- Assets (Coffeescript, LESS)

Detect errors as early as possible

Page 6: Play framework 2

6

Conventions of configurations

Vast structure

A lot of functionalities come with the core bundle

Page 7: Play framework 2

7

build.sbt

Page 8: Play framework 2

8

app/models

Page 9: Play framework 2

9

app/controllers

Page 10: Play framework 2

10

app/views

Page 11: Play framework 2

11

conf/application.config

Page 12: Play framework 2

12

conf/messages

Page 13: Play framework 2

13

conf/routes

Page 14: Play framework 2

14

Hot reloading

Start server once

Make code change

Hit F5 in browser

Change is live!

Page 15: Play framework 2

15

Errors displayed in browser

Compilation and runtime errors are displayed in browser

Go fix and hit F5!

Page 16: Play framework 2

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

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

18

Creating a new project

Via terminal/console:

- activator new

- Choose template/seed

- Pick a name

Page 19: Play framework 2

19

Creating a new project

Via UI:

- activator ui

- Pick seed

- Choose locationfor the project

Page 20: Play framework 2

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 22: Play framework 2

22

Follow tutorials

Page 23: Play framework 2

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

24

Q&A