SlideShare uma empresa Scribd logo
1 de 42
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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 WindowsChef Software, Inc.
 
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 EnvironmentDocker, 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
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshopjtimberman
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with ChefJonathan Weiss
 
Distributed automation sel_conf_2015
Distributed automation sel_conf_2015Distributed automation sel_conf_2015
Distributed automation sel_conf_2015aragavan
 
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 ChefChef Software, Inc.
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Jennifer Davis
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitJennifer Davis
 
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 CodeJosh Padnick
 
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 2017Matthew Groves
 
SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantMitchell Hashimoto
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with ChefRaimonds Simanovskis
 
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!James Casey
 
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…Sergey Dzyuban
 
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 )Pravin Mishra
 
Chef-Zero & Local Mode
Chef-Zero & Local ModeChef-Zero & Local Mode
Chef-Zero & Local ModeMichael Goetz
 
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 1Chef
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as codeAxel Quack
 

Mais procurados (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
 

Semelhante a Intro to Modern Java Web Development with Play Framework

Java Coaching in Hyderabad introduction
Java Coaching in Hyderabad  introductionJava Coaching in Hyderabad  introduction
Java Coaching in Hyderabad introductionAzure Data Factory
 
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 Elad Hirsch
 
Decoupled Architecture and WordPress
Decoupled Architecture and WordPressDecoupled Architecture and WordPress
Decoupled Architecture and WordPressPantheon
 
Netbeans65 Osum Slides
Netbeans65 Osum SlidesNetbeans65 Osum Slides
Netbeans65 Osum SlidesAbhishek Gupta
 
Modern Web Framework : Play framework
Modern Web Framework : Play frameworkModern Web Framework : Play framework
Modern Web Framework : Play frameworkSuman Adak
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationJonathan Abrams
 
Curriculum vitae of nguyen hai quy
Curriculum vitae of nguyen hai quyCurriculum vitae of nguyen hai quy
Curriculum vitae of nguyen hai quyHai Quy Nguyen
 
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 2014Arun Gupta
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The BasicsPhilip Langer
 
Building Rich Applications with Appcelerator
Building Rich Applications with AppceleratorBuilding Rich Applications with Appcelerator
Building Rich Applications with AppceleratorMatt Raible
 
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 importancenishajj
 
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 abile technologies
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Bluegrass Digital
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?Balajihope
 
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 2011Arun Gupta
 
Open Innovation means Open Source
Open Innovation means Open SourceOpen Innovation means Open Source
Open Innovation means Open SourceBertrand Delacretaz
 
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...Katy Slemon
 

Semelhante a Intro to Modern Java Web Development with Play Framework (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...
 

Último

GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROmotivationalword821
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 

Último (20)

GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTRO
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 

Intro to Modern Java Web Development with Play Framework

  • 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