SlideShare une entreprise Scribd logo
1  sur  42
Télécharger pour lire hors ligne
Intro to Play Framework &	

Modern Java Web App Development
Josh Padnick	

Desert Code Camp 2013.2	

November 9, 2013
Today’sTalk
• Java Web App DevelopmentToday	

• Modern Web App Development	

• Meet Play Framework	

• Build Stuff!
• Founder & Chief Innovation Officer at Omedix	

• 10+ years of web app development	

• Special interest in scalable, enterprise, web-based
applications using Java & open source
Josh
 Padnick
Java Web App 	

DevelopmentToday
Challenges
 of^
Lots ofTime Waiting for Server Redeploys…
SOURCE FOR INSIGHT:The Play Framework at LinkedIn: Productivity and Performance at Scale byYevjeniy Brikman

http://www.youtube.com/watch?v=8z3h4Uv9YbE	

!
SOURCE FOR GRAPHIC: http://zeroturnaround.com/rebellabs/java-ee-productivity-report-2011/#redeploy_times
Long, Ugly Error Messages
SOURCE: FOR INSIGHT:The Play Framework at LinkedIn: Productivity and Performance at Scale byYevjeniy Brikman

http://www.youtube.com/watch?v=8z3h4Uv9YbE	

!
SOURCE FOR GRAPHIC: http://ptrthomas.wordpress.com/2006/06/06/java-call-stack-from-http-upto-jdbc-as-a-picture/	

MVC Action
AOP TX Proxy
Business Logic
DAO
Spring-Hibernate
Hibernate
JDBC
Spring WebFlow
Spring MVC
?xml version=1.0 encoding=UTF-8?
web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
!
servlet
servlet-namemvc/servlet-name
servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class
!-- we'll use AnnotationConfigWebApplicationContext instead of the default XmlWebApplicationContext... --
init-param
param-namecontextClass/param-name
param-valueorg.springframework.web.context.support.AnnotationConfigWebApplicationContext/param-value
/init-param
!
!-- ... and tell it which class contains the configuration --
init-param
param-namecontextConfigLocation/param-name
param-valuecom.zt.helloWeb.init.WebappConfig/param-value
/init-param
!
load-on-startup1/load-on-startup
!
/servlet
!
servlet-mapping
servlet-namemvc/servlet-name
url-pattern//url-pattern
/servlet-mapping
!
welcome-file-list
welcome-file//welcome-file
/welcome-file-list
!
/web-app
DefaultServletHandler
Crazy XML Configuration
SOURCE FOR INSIGHT:The Play Framework at LinkedIn: Productivity and Performance at Scale byYevjeniy Brikman

http://www.youtube.com/watch?v=8z3h4Uv9YbE
Bean Failures
org.omg.CORBA.OBJECT_NOT_EXIST
SOURCE FOR GRAPHIC: Beginning Java EE 6 Platform with Glassfish 3 by Antonio Goncalves, Page 5.
X
Clunky Road to	

RESTful URLs
WEB.XML
servlet-mapping
servlet-namespringmvc/servlet-name
url-pattern/rest/*/url-pattern
/servlet-mapping
!
CONTROLLER.JAVA
@Controller
@RequestMapping(/people)
public class PeopleController {
!
@RequestMapping(“entrypoint/{collectionName}”, method=RequestMethod.GET)
public @ResponseBody String getPeople() {
return GsonFactory.getInstance().toJson(LookupDao.getInstance().getP
}
!
@RequestMapping(value={id}, method=RequestMethod.GET)
public @ResponseBody String getPerson(@PathVariable String id) {
return GsonFactory.getInstance().toJson(LookupDao.getInstance().getP
}
}
A Lot of Complexity!
I just want to write working software!
Is this the architecture we would create today?
The root of the problem
Impedance Mismatch between 	

HTTP and Java EE!
RESTful URLs vs. Java Servlets Spec
Impedance Mismatch
Stateless HTTP vs. Stateful EJBs
SOURCE: http://cscie12.dce.harvard.edu/lecture_notes/2011/20110504/handout.html 	

SOURCE: Beginning Java EE 6 Platform with Glassfish 3 by Antonio Goncalves, Page 206.	

Impedance Mismatch
Impedance Mismatch
Code  Refresh vs. WAR Deployment
Modern Web App Development
Buzzwords!
• HTML5  Javascript
• MVVM Frameworks
• Mobile
• NoSQL
• Real-Time
• Big Data
• Asynchronous
• Immutability
• Connected Devices
Reactive Software
http://www.ReactiveManifesto.org/
The Reactive Manifesto
“Application requirements have changed dramatically in recent years. Both
from a runtime environment perspective, with multicore and cloud computing
architectures nowadays being the norm, as well as from a user requirements
perspective, with tighter SLAs in terms of lower latency, higher throughput,
availability and close to linear scalability.This all demands writing applications in
a fundamentally different way than what most programmers are used to.”
SOURCE: http://typesafe.com/blog/why_do_we_need_a_reactive_manifesto
Jonas Bonér
Reactive Software
SOURCE: http://www.ReactiveManifesto.org/
Meet Play Framework
Goal: Performance + Productivity
Performance
Productivity
SOURCE: http://typesafe.com/blog/webinar-a-java-developers-primer-to-the-typesafe-platform
No More JEE Container
SOURCE: Play for Java by Nicolas Leroux and Sietse de Kaper
Focused on Developer Productivity
• Live code changes when you refresh the browser	

• More friendly error messages directly in browser	

• Type safety in the templates	

• Cool console  build tools
Designed for the Modern Web
• RESTful by default	

• Auto-compile LESS and CoffeeScript files	

• JSON is a first-class citizen	

• Websockets, other HTTP Streaming Support
Stateless and Built for Scale
• Forces every aspect of your app to be stateless	

• Non-Blocking I/O	

• Well-suited for real-time
What exactly is it, though?
SOURCE: Play for Java by Nicolas Leroux and Sietse de Kaper
What exactly is it, though?
Integrated HTTP Server	

JBoss Netty (Non-Blocking IO)
Concurrent, Distributed, Fault-Tolerant 	

Background Processing	

Akka
Build System 	

Console	

SBT
JavaVirtual Machine
Template Engine, HTTP Request/Response Processing, Integrated
Cache, RESTful Routing Engine,Asset Compilation,
Internationalization,TestingTools	

Play Framework
eBean / Anorm
BoneCP
H2 Database
Lots of libraries…
Of course, nothing’s perfect
1. You can mostly avoid Scala, but not completely

(of course, Scala itself is pretty cool)	

2. For advanced build logic, SBT has a steep learning curve	

3. Template system works well, but sometimes the functional
paradigm can feel awkward
Let’s around!
Intro Stuff
1. Download and install	

2. Play Console	

3. Controllers	

4. URL Routing	

5. Templates
Intro Stuff
1. Download and install
2. Play Console	

3. Controllers	

4. URL Routing	

5. Templates
Intro Stuff
1. Download and install	

2. Play Console
3. Controllers	

4. URL Routing	

5. Templates
Intro Stuff
1. Download and install	

2. Play Console	

3. Controllers
4. URL Routing	

5. Templates
Intro Stuff
1. Download and install	

2. Play Console	

3. Controllers	

4. URL Routing
5. Templates
Intro Stuff
1. Download and install	

2. Play Console	

3. Controllers	

4. URL Routing	

5. Templates
Let’s Build Something	

in theTime Remaining
So what did you like best today?
• We’ll take some votes and show the results real-time
Learning Play Framework
• I preferred the books to the documentation	

• For official documentation, best formatting is on
playframework.com. Latest content is on github

(https://github.com/playframework/playframework/tree/master/documentation/manual)	

• Community itself is pretty great	

• Google Group is great 	

• Lots of questions on Stack Overflow

Contenu connexe

Tendances

DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing EnvironmentDCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
Docker, Inc.
 
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Simplilearn
 
SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing Vagrant
Mitchell Hashimoto
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
Axel Quack
 

Tendances (20)

Opscode Webinar: Cooking with Chef on Microsoft Windows
Opscode Webinar: Cooking with Chef on Microsoft WindowsOpscode Webinar: Cooking with Chef on Microsoft Windows
Opscode Webinar: Cooking with Chef on Microsoft Windows
 
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing EnvironmentDCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
 
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshop
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
Distributed automation sel_conf_2015
Distributed automation sel_conf_2015Distributed automation sel_conf_2015
Distributed automation sel_conf_2015
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with Chef
 
Learning chef
Learning chefLearning chef
Learning chef
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
 
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In CodeIntroduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing Vagrant
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with Chef
 
Chef Actions: Delightful near real-time activity tracking!
Chef Actions: Delightful near real-time activity tracking!Chef Actions: Delightful near real-time activity tracking!
Chef Actions: Delightful near real-time activity tracking!
 
To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…
 
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )
 
Chef-Zero & Local Mode
Chef-Zero & Local ModeChef-Zero & Local Mode
Chef-Zero & Local Mode
 
Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
 

Similaire à Play Framework: Intro & High-Level Overview

Netbeans65 Osum Slides
Netbeans65 Osum SlidesNetbeans65 Osum Slides
Netbeans65 Osum Slides
Abhishek Gupta
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
Philip Langer
 

Similaire à Play Framework: Intro & High-Level Overview (20)

Java Coaching in Hyderabad introduction
Java Coaching in Hyderabad  introductionJava Coaching in Hyderabad  introduction
Java Coaching in Hyderabad introduction
 
AngularJS - Architecture decisions in a large project 
AngularJS - Architecture decisionsin a large project AngularJS - Architecture decisionsin a large project 
AngularJS - Architecture decisions in a large project 
 
Decoupled Architecture and WordPress
Decoupled Architecture and WordPressDecoupled Architecture and WordPress
Decoupled Architecture and WordPress
 
Netbeans65 Osum Slides
Netbeans65 Osum SlidesNetbeans65 Osum Slides
Netbeans65 Osum Slides
 
Modern Web Framework : Play framework
Modern Web Framework : Play frameworkModern Web Framework : Play framework
Modern Web Framework : Play framework
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig Presentation
 
Frameworks in java
Frameworks in javaFrameworks in java
Frameworks in java
 
Curriculum vitae of nguyen hai quy
Curriculum vitae of nguyen hai quyCurriculum vitae of nguyen hai quy
Curriculum vitae of nguyen hai quy
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
 
Building Rich Applications with Appcelerator
Building Rich Applications with AppceleratorBuilding Rich Applications with Appcelerator
Building Rich Applications with Appcelerator
 
Follow these reasons to know java’s importance
Follow these reasons to know java’s importanceFollow these reasons to know java’s importance
Follow these reasons to know java’s importance
 
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?
 
The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011
 
Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open Source
 
NodeJS and what is actually does
NodeJS and what is actually doesNodeJS and what is actually does
NodeJS and what is actually does
 
React.js alternatives modern web frameworks and lightweight java script libr...
React.js alternatives  modern web frameworks and lightweight java script libr...React.js alternatives  modern web frameworks and lightweight java script libr...
React.js alternatives modern web frameworks and lightweight java script libr...
 

Dernier

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Dernier (20)

%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

Play Framework: Intro & High-Level Overview

  • 1. Intro to Play Framework & Modern Java Web App Development Josh Padnick Desert Code Camp 2013.2 November 9, 2013
  • 2. Today’sTalk • Java Web App DevelopmentToday • Modern Web App Development • Meet Play Framework • Build Stuff!
  • 3. • Founder & Chief Innovation Officer at Omedix • 10+ years of web app development • Special interest in scalable, enterprise, web-based applications using Java & open source Josh
  • 5. Java Web App DevelopmentToday Challenges
  • 7. Lots ofTime Waiting for Server Redeploys… SOURCE FOR INSIGHT:The Play Framework at LinkedIn: Productivity and Performance at Scale byYevjeniy Brikman
 http://www.youtube.com/watch?v=8z3h4Uv9YbE ! SOURCE FOR GRAPHIC: http://zeroturnaround.com/rebellabs/java-ee-productivity-report-2011/#redeploy_times
  • 8. Long, Ugly Error Messages SOURCE: FOR INSIGHT:The Play Framework at LinkedIn: Productivity and Performance at Scale byYevjeniy Brikman
 http://www.youtube.com/watch?v=8z3h4Uv9YbE ! SOURCE FOR GRAPHIC: http://ptrthomas.wordpress.com/2006/06/06/java-call-stack-from-http-upto-jdbc-as-a-picture/ MVC Action AOP TX Proxy Business Logic DAO Spring-Hibernate Hibernate JDBC Spring WebFlow Spring MVC
  • 9. ?xml version=1.0 encoding=UTF-8? web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd ! servlet servlet-namemvc/servlet-name servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class !-- we'll use AnnotationConfigWebApplicationContext instead of the default XmlWebApplicationContext... -- init-param param-namecontextClass/param-name param-valueorg.springframework.web.context.support.AnnotationConfigWebApplicationContext/param-value /init-param ! !-- ... and tell it which class contains the configuration -- init-param param-namecontextConfigLocation/param-name param-valuecom.zt.helloWeb.init.WebappConfig/param-value /init-param ! load-on-startup1/load-on-startup ! /servlet ! servlet-mapping servlet-namemvc/servlet-name url-pattern//url-pattern /servlet-mapping ! welcome-file-list welcome-file//welcome-file /welcome-file-list ! /web-app DefaultServletHandler Crazy XML Configuration SOURCE FOR INSIGHT:The Play Framework at LinkedIn: Productivity and Performance at Scale byYevjeniy Brikman
 http://www.youtube.com/watch?v=8z3h4Uv9YbE
  • 10. Bean Failures org.omg.CORBA.OBJECT_NOT_EXIST SOURCE FOR GRAPHIC: Beginning Java EE 6 Platform with Glassfish 3 by Antonio Goncalves, Page 5. X
  • 11. Clunky Road to RESTful URLs WEB.XML servlet-mapping servlet-namespringmvc/servlet-name url-pattern/rest/*/url-pattern /servlet-mapping ! CONTROLLER.JAVA @Controller @RequestMapping(/people) public class PeopleController { ! @RequestMapping(“entrypoint/{collectionName}”, method=RequestMethod.GET) public @ResponseBody String getPeople() { return GsonFactory.getInstance().toJson(LookupDao.getInstance().getP } ! @RequestMapping(value={id}, method=RequestMethod.GET) public @ResponseBody String getPerson(@PathVariable String id) { return GsonFactory.getInstance().toJson(LookupDao.getInstance().getP } }
  • 12. A Lot of Complexity!
  • 13. I just want to write working software!
  • 14. Is this the architecture we would create today?
  • 15. The root of the problem Impedance Mismatch between HTTP and Java EE!
  • 16. RESTful URLs vs. Java Servlets Spec Impedance Mismatch
  • 17. Stateless HTTP vs. Stateful EJBs SOURCE: http://cscie12.dce.harvard.edu/lecture_notes/2011/20110504/handout.html SOURCE: Beginning Java EE 6 Platform with Glassfish 3 by Antonio Goncalves, Page 206. Impedance Mismatch
  • 18. Impedance Mismatch Code Refresh vs. WAR Deployment
  • 19. Modern Web App Development
  • 20. Buzzwords! • HTML5 Javascript • MVVM Frameworks • Mobile • NoSQL • Real-Time • Big Data • Asynchronous • Immutability • Connected Devices
  • 22. The Reactive Manifesto “Application requirements have changed dramatically in recent years. Both from a runtime environment perspective, with multicore and cloud computing architectures nowadays being the norm, as well as from a user requirements perspective, with tighter SLAs in terms of lower latency, higher throughput, availability and close to linear scalability.This all demands writing applications in a fundamentally different way than what most programmers are used to.” SOURCE: http://typesafe.com/blog/why_do_we_need_a_reactive_manifesto Jonas Bonér
  • 25. Goal: Performance + Productivity Performance Productivity SOURCE: http://typesafe.com/blog/webinar-a-java-developers-primer-to-the-typesafe-platform
  • 26. No More JEE Container SOURCE: Play for Java by Nicolas Leroux and Sietse de Kaper
  • 27. Focused on Developer Productivity • Live code changes when you refresh the browser • More friendly error messages directly in browser • Type safety in the templates • Cool console build tools
  • 28. Designed for the Modern Web • RESTful by default • Auto-compile LESS and CoffeeScript files • JSON is a first-class citizen • Websockets, other HTTP Streaming Support
  • 29. Stateless and Built for Scale • Forces every aspect of your app to be stateless • Non-Blocking I/O • Well-suited for real-time
  • 30. What exactly is it, though? SOURCE: Play for Java by Nicolas Leroux and Sietse de Kaper
  • 31. What exactly is it, though? Integrated HTTP Server JBoss Netty (Non-Blocking IO) Concurrent, Distributed, Fault-Tolerant Background Processing Akka Build System Console SBT JavaVirtual Machine Template Engine, HTTP Request/Response Processing, Integrated Cache, RESTful Routing Engine,Asset Compilation, Internationalization,TestingTools Play Framework eBean / Anorm BoneCP H2 Database Lots of libraries…
  • 32. Of course, nothing’s perfect 1. You can mostly avoid Scala, but not completely
 (of course, Scala itself is pretty cool) 2. For advanced build logic, SBT has a steep learning curve 3. Template system works well, but sometimes the functional paradigm can feel awkward
  • 34. Intro Stuff 1. Download and install 2. Play Console 3. Controllers 4. URL Routing 5. Templates
  • 35. Intro Stuff 1. Download and install 2. Play Console 3. Controllers 4. URL Routing 5. Templates
  • 36. Intro Stuff 1. Download and install 2. Play Console 3. Controllers 4. URL Routing 5. Templates
  • 37. Intro Stuff 1. Download and install 2. Play Console 3. Controllers 4. URL Routing 5. Templates
  • 38. Intro Stuff 1. Download and install 2. Play Console 3. Controllers 4. URL Routing 5. Templates
  • 39. Intro Stuff 1. Download and install 2. Play Console 3. Controllers 4. URL Routing 5. Templates
  • 40. Let’s Build Something in theTime Remaining
  • 41. So what did you like best today? • We’ll take some votes and show the results real-time
  • 42. Learning Play Framework • I preferred the books to the documentation • For official documentation, best formatting is on playframework.com. Latest content is on github
 (https://github.com/playframework/playframework/tree/master/documentation/manual) • Community itself is pretty great • Google Group is great • Lots of questions on Stack Overflow
  • 44. QA