Академический Документы
Профессиональный Документы
Культура Документы
Josh Padnick
Desert Code Camp 2013.2
November 9, 2013
Today’s Talk
• Build Stuff!
P ni ck
Jos h
ad
SOURCE FOR INSIGHT: The Play Framework at LinkedIn: Productivity and Performance at Scale by Yevjeniy Brikman
http://www.youtube.com/watch?v=8z3h4Uv9YbE
!
SOURCE FOR GRAPHIC: http://zeroturnaround.com/rebellabs/java-ee-productivity-report-2011/#redeploy_times
Spring MVC
Long, Ugly Error Messages
Spring WebFlow
MVC Action
AOP TX Proxy
Business Logic
DAO
Spring-Hibernate
Hibernate
JDBC
SOURCE: FOR INSIGHT: The Play Framework at LinkedIn: Productivity and Performance at Scale by Yevjeniy 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/
Crazy XML Configuration
<?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-name>mvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- we'll use AnnotationConfigWebApplicationContext instead of the default XmlWebApplicationContext... -->
<init-param>
<param-name>contextClass</param-name>
<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
</init-param>
!
<!-- ... and tell it which class contains the configuration -->
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>com.zt.helloWeb.init.WebappConfig</param-value>
</init-param>
!
<load-on-startup>1</load-on-startup>
!
</servlet>
!
<servlet-mapping>
<servlet-name>mvc</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
!
<welcome-file-list>
<welcome-file>/</welcome-file>
</welcome-file-list>
!
</web-app>
DefaultServletHandler
SOURCE FOR INSIGHT: The Play Framework at LinkedIn: Productivity and Performance at Scale by Yevjeniy 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.
Clunky Road to
RESTful URLs
WEB.XML
<servlet-mapping>
<servlet-name>springmvc</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
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
• 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.”
Jonas Bonér
SOURCE: http://typesafe.com/blog/why_do_we_need_a_reactive_manifesto
Reactive Software
SOURCE: http://www.ReactiveManifesto.org/
Meet Play Framework
Goal: Performance + Productivity
Productivity
Performance
SOURCE: http://typesafe.com/blog/webinar-a-java-developers-primer-to-the-typesafe-platform
No More JEE Container
• Non-Blocking I/O
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 the Time 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