If you are a web developer, familiar with the MVC concept, but never used Play! Framework, here is a chance for you to get a glance at how easy it can be to create web applications with Java. Using the standard techniques available out there we will create a simple web application from scratch and deploy it into the cloud within 45 minutes, using Java, Scala, Heroku and Play! Framework.
From nothing to the cloud in 45 minutes with Play Framework.
1. ”From nothing to the
cloud in 45 minutes”
amework
ith Play Fr
w
Helena Hjertén @javaHelena & Johan Andrén @apnylle Software Passion 2012
2. Who are we?
Helena Hjertén, @javaHelena
Chairman of Duchess Sweden
Java, Web
Johan Andrén, @apnylle
https://markatta.com/johan/codemonkey/
Java, Scala, Web
Helena Hjertén @javaHelena & Johan Andrén @apnylle Software Passion 2012
3. Who are you?
Helena Hjertén @javaHelena & Johan Andrén @apnylle Software Passion 2012
5. What is Play! Framework?
Web Framework - MVC, RESTful
Runs on the JVM
All inclusive Framework
Built in components (Web server, template engine etc)
Open source
since 2009 (initially created in 2007 at Zenexity)
v. 1.x (written in Java) - for java (& scalaplugin)
v. 2.0 (rewritten in scala) - for java & scala
released on March 13th (2012)
Part of the Typesafe stack - http://typesafe.com
Inspired by ”Ruby on Rails” and Django
Helena Hjertén @javaHelena & Johan Andrén @apnylle Software Passion 2012
6. Why Play! Framework?
Easy to get started
Easy to work with
download, unpack, start developing
Hot Reloading
Web for java developers (and scala)
Open Source
Helena Hjertén @javaHelena & Johan Andrén @apnylle Software Passion 2012
7. Play! Components?
”Full Stack Aspect” - bundle wihtin Play:
JBoss Netty - web server
Ebean, Anorm, JPA - data layer
Selenium, JUnit - for testing
Modular architecture - Modules
1.x CRUD, Security, / scala, mongodb ...
2.0 modules - work in progress
https://github.com/playframework/Play20/wiki
Helena Hjertén @javaHelena & Johan Andrén @apnylle Software Passion 2012
9. Create a new app
Run the app in the web browser locally
Open the source code in IntelliJ Idea (IDE)
Modify the code
Modify the configuration
Initiate git
Push to Heroku
Make it look nice
Use our app on the Internet
http://sp2012.herokuapp.com
Done
Helena Hjertén @javaHelena & Johan Andrén @apnylle Software Passion 2012
10. Time for
Demo!
Helena Hjertén @javaHelena & Johan Andrén @apnylle Software Passion 2012
11. Create a new app
Run the app in the web browser locally
Open the source code in IntelliJ Idea (IDE)
Modify the code
Modify the configuration
Initiate git
Push to Heroku
Make it look nice
Use our app on the Internet
http://sp2012.herokuapp.com
Done
Helena Hjertén @javaHelena & Johan Andrén @apnylle Software Passion 2012
12. Modify the code
Created a MODEL
list all - desc sort order
db connection, validation
Changed the VIEW
added a list
added a form
Changed the CONTROLLER
changed the index method.
added an ”add” method, validation
Helena Hjertén @javaHelena & Johan Andrén @apnylle Software Passion 2012
13. Create a new app
Run the app in the web browser locally
Open the source code in IntelliJ Idea (IDE)
Modify the code
Modify the configuration
Initiate git
Push to Heroku
Make it look nice
Use our app on the Internet
http://sp2012.herokuapp.com
Done
Helena Hjertén @javaHelena & Johan Andrén @apnylle Software Passion 2012
15. Contact
Helena Hjertén, @javaHelena
helena.hjerten@mejsla.se
Johan Andrén, @apnylle
johan.andren@mejsla.se
https://markatta.com/johan/codemonkey
Helena Hjertén @javaHelena & Johan Andrén @apnylle Software Passion 2012
Editor's Notes
Welcome.. \nMy name.\nTake a picture!\n
\n
Java? Scala? .Net? Web? Ruby on Rails? Django? Other languages.\n
So, How are we going to go from nothing to the cloud in 45 minutes. \nHeroku a cloud application platform supporting Play Framework\n\n
- integrates the components and APIs you need for modern web application development.\n- aims to optimize developer productivity\nStateless: Play is fully RESTful - there is no Java EE session per connection. This makes Play more outwardly-scalable than many other frameworks.\n\nIn May 2008 the first published code for 1.0 appeared on Launchpad.[6] This was followed by a full 1.0 release in October 2009.[7]\nPlay 1.1 was released in November 2010 after a move from Launchpad to GitHub. It included a migration fromApache MINA to JBoss Netty, Scala support, native GlassFish container, an asynchronous web serviceslibrary, OAuth support, HTTPS support and other features.[8]\nPlay 1.2 was released in April 2011. It included dependency management with Apache Ivy, support forWebSockets, integrated database migration (reversion is not implemented yet[9]), a switch to the H2 database and other features.[10]\nPlay 2.0 was released on March 13, 2012 [11] in conjunction with Typesafe Stack 2.0. [12]\n[edit]\n\n
Hot reloading - decrease the waiting time during development, and increase the DX - developer experience.\n
Here are some of the built in components\nRegarding modules - Play is designed to work with modules, so the community will create modules, but some will be included in the framework from the start \n\n\n
\n
So this is what we will do on our live coding session\n
\n
På Modify code - gå till nästa slide\n