SlideShare une entreprise Scribd logo
1  sur  35
Hands-on Web Development
          with
        Play 2.0!
        Abbas Raza
     Jean-Baptiste Volta
Gratitude

     YOU for stopping by!!

 SVCC for organizing the Camp

Guillaime Bort for Play Framework
Game Plan
Play Framework Primer (~ 15 min)
           - Concepts
         - Architecture
            - Artifacts

 It’s Play time (Rest of session)
         - Setting up Play
 - Building App Step-by-Step
What’s Play?
Designed by web developers for web
 developers

Brings high-productivity web
  development to
the JVM

Greatly enhances developer
 experience (DX)
Full stack web
  framework
Java and Scala
  support
High productivity
Stateless architecture
HTTP centric
Typesafe
Asynchronous
Highly scalable
Integrated testing
High Productivity
Make changes and hit reload in Java
 world!!
Compile-time checking
Type-safe
Console
Built-in server
Useful error reporting
Compile-time Checking
Checks almost all the artifacts at
 compile-time
  – Java/Scala code
  – Templates
  – Routes
  – Config
  – Javascript (via Google Closure)
  – LESS
  – Coffeescript
Stack trace – Ring a bell?!
Error Reporting
Browser error reporting
Simplified and useful info
Error Reporting
HTTP Centric
Designed around HTTP, hence
 stateless
State either at client or in persistence
 layer
Back button works!
Does not fight HTTP or the browser
 - leverages the power of HTTP
Why complicate URLs?

http://www.coolsite.com/cooler/fe/l
=en_US/p/Organizer/CoolerID=9
909873008/a=90875276_2885276
/invalidateCoolerCache=true/b_c=
119/b_otsc=SHR/b_otsi=SPIUU
B/s_ev20=jhuC%7CSHR
%7COTSI
%7CSPICFB/s_pt=REP,HUY,S
LO,EE2,FRE,FER#provin=mic
Clean URL Design
URL design part of the application
  design
URL is an interface – a contract not
  implementation
URLs are human and machine friendly
For instance
http://localhost:9000/#/projects/3/tasks
Modern Web Development
HTML5
CoffeeScript
LESS
Bootstrap
Testing
Spec2 - Default way to test
Test controller, router, template
Test from browser
Cloud Deployment
Heroku
CloudFoundry
OpenShift
Cloudbees
Architecture
Downloading & Installation
Download the binaries from
 http://www.playframework.com/down
 load
Latest version – 2.0.4
Unzip it to any location
Add play to path
Create New Project
Run the following command
$ play new coolApp

“Start” the application with
$ cd coolApp
$ play run
Directory Structure
Application Configuration
Configuration properties for any
 application.
Examples include database connection
 info.
File located at:
 <Project>/conf/application.conf
A typical entry looks like:
  – db.default.driver=org.h2.Driver
application.conf
Router
What: Routes requests to appropriate
 controller
Where: File located at:
 <Project>/conf/routes
Typical entries:
GET /
 controllers.Application.index
routes
Controllers
Controller serves requests
Contains business logic
Located at <project>/app/controllers
Controllers
package controllers

import play.api._
import play.api.mvc._

object Application extends Controller {
  def index = Action {
   Ok("Hello, Rockstar")
 }
}
Templates
Template encapsulates HTML to be
  rendered
Is a Scala function
Is type-safe
Are compiled into classes for run-time
Templates
@(user: User)(body: Html)
<html>
  <body>
    <header>
       <dl id="user">
         <dt>@user.name</dt>
       </dl>
    </header>
    <section id="main">
       @body
    </section>
  </body>
</html>
IDE Support
Eclipse
  – eclipsify
IntelliJ
  – idea
Netbeans
  – netbeans
ScalaIDE
Free Online Scala Course
           by
     Martin Odersky


http://www.coursera.org/course/prog
  fun
It’s Play time
Implement a Lean Startup concept

Lean Startup Movement mandates
 validating the pain point before
 building any product

Step-by-step development of the
 application from scratch
Thank You!!
References
http://www.playframework.com

Play 2 with Scala in Action by Peter Hilton,
  Erik Bakker, Francisco Canedo
Image References
‘Lets play’ - http://www.drpeppersnapplegroup.com/smedia/www/2011/04/11/img-lets-
    play460x300_223742710844.jpg
‘Architecture diagram’ – http://www.playframework.org

Contenu connexe

Tendances

Automated Testing Overview
Automated Testing OverviewAutomated Testing Overview
Automated Testing Overview
antsh
 

Tendances (20)

Automated Testing Overview
Automated Testing OverviewAutomated Testing Overview
Automated Testing Overview
 
Cross browser testing
Cross browser testingCross browser testing
Cross browser testing
 
Selenium
SeleniumSelenium
Selenium
 
Controlling the browser through python and selenium
Controlling the browser through python and seleniumControlling the browser through python and selenium
Controlling the browser through python and selenium
 
Jenkins & Selenium
Jenkins & SeleniumJenkins & Selenium
Jenkins & Selenium
 
Automation Testing
Automation TestingAutomation Testing
Automation Testing
 
Guide To Effective Cross Browser Testing
Guide To Effective Cross Browser TestingGuide To Effective Cross Browser Testing
Guide To Effective Cross Browser Testing
 
Tutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopTutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer Workshop
 
Embrace Native Async Nature of JavaScript in WebDriver JS - SeleniumConf Aust...
Embrace Native Async Nature of JavaScript in WebDriver JS - SeleniumConf Aust...Embrace Native Async Nature of JavaScript in WebDriver JS - SeleniumConf Aust...
Embrace Native Async Nature of JavaScript in WebDriver JS - SeleniumConf Aust...
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous Deployment
 
Testing Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumTesting Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS Curriculum
 
Selenium-Grid-Extras
Selenium-Grid-ExtrasSelenium-Grid-Extras
Selenium-Grid-Extras
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with Drupal
 
Automated testing with Cypress
Automated testing with CypressAutomated testing with Cypress
Automated testing with Cypress
 
Selenium testing
Selenium testingSelenium testing
Selenium testing
 
iOS Automation with Cucumber, Appium and Saucelabs
iOS Automation with Cucumber, Appium and SaucelabsiOS Automation with Cucumber, Appium and Saucelabs
iOS Automation with Cucumber, Appium and Saucelabs
 
SQL Server - CLR integration
SQL Server - CLR integrationSQL Server - CLR integration
SQL Server - CLR integration
 
Speed = $$$
Speed = $$$Speed = $$$
Speed = $$$
 
Modern Web Application Development Workflow - EclipseCon US 2014
Modern Web Application Development Workflow - EclipseCon US 2014Modern Web Application Development Workflow - EclipseCon US 2014
Modern Web Application Development Workflow - EclipseCon US 2014
 
Serhiy Kalinets "Console: why should we care?"[Lightning talk]
Serhiy Kalinets "Console: why should we care?"[Lightning talk]Serhiy Kalinets "Console: why should we care?"[Lightning talk]
Serhiy Kalinets "Console: why should we care?"[Lightning talk]
 

Similaire à Hands on web development with play 2.0

eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
vstorm83
 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
Fred Sauer
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
Philip Langer
 
Arm html5 presentation
Arm html5 presentationArm html5 presentation
Arm html5 presentation
Ian Renyard
 

Similaire à Hands on web development with play 2.0 (20)

Introduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and SilverlightIntroduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and Silverlight
 
Get Ahead with HTML5 on Moible
Get Ahead with HTML5 on MoibleGet Ahead with HTML5 on Moible
Get Ahead with HTML5 on Moible
 
Windows azure overview for SharePoint Pros
Windows azure overview for SharePoint Pros Windows azure overview for SharePoint Pros
Windows azure overview for SharePoint Pros
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
Introduction to Codenvy / JugSummerCamp 2014
Introduction to Codenvy / JugSummerCamp 2014Introduction to Codenvy / JugSummerCamp 2014
Introduction to Codenvy / JugSummerCamp 2014
 
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design
 
AWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for Developers
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 
Web assembly with PWA
Web assembly with PWA Web assembly with PWA
Web assembly with PWA
 
Windows Azure Web Sites - Things they don’t teach kids in school - Comunity D...
Windows Azure Web Sites- Things they don’t teach kids in school - Comunity D...Windows Azure Web Sites- Things they don’t teach kids in school - Comunity D...
Windows Azure Web Sites - Things they don’t teach kids in school - Comunity D...
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
 
Arm html5 presentation
Arm html5 presentationArm html5 presentation
Arm html5 presentation
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
 
Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5
 
HTML5 Intoduction for Web Developers
HTML5 Intoduction for Web DevelopersHTML5 Intoduction for Web Developers
HTML5 Intoduction for Web Developers
 
An Introduction to Web Components
An Introduction to Web ComponentsAn Introduction to Web Components
An Introduction to Web Components
 
System Center Universe Europe 2014 - Jakob Gottlieb Svendsen - Service Manag...
System Center Universe Europe 2014 - Jakob Gottlieb Svendsen -  Service Manag...System Center Universe Europe 2014 - Jakob Gottlieb Svendsen -  Service Manag...
System Center Universe Europe 2014 - Jakob Gottlieb Svendsen - Service Manag...
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Hands on web development with play 2.0