SlideShare une entreprise Scribd logo
1  sur  39
Building Play 2.0
Applications on
CloudFoundry
Rajdeep Dua
Director, DevRel VMware India
@rajdeepdua
Why Play?
For years PHP, Ruby developers have
   been laughing at Java developers
every time they change and refresh the
                 page
..and all of us evolve



                                  Grails
JVM     Servlets   JEE   Spring

                                   Play
..and all of us evolve



                                  Grails
JVM     Servlets   JEE   Spring

                                   Play
Play doesn’t fight HTTP or the
           Browser
Play doesn’t fight HTTP or the
           Browser
       Stateless, HTTP Centric,
      Easier development lifecycle
Play 2.0 Overview
Play 2.0 Overview
• Web framework written in Java and Scala
Play 2.0 Overview
• Web framework written in Java and Scala
• Not built on top of Servlet APIs
Play 2.0 Overview
• Web framework written in Java and Scala
• Not built on top of Servlet APIs
• Statically typed MVC Architecture
Play 2.0 Overview
• Web framework written in Java and Scala
• Not built on top of Servlet APIs
• Statically typed MVC Architecture
• Asynchronous HTTP Programming Model
Play 2.0 Overview
• Web framework written in Java and Scala
• Not built on top of Servlet APIs
• Statically typed MVC Architecture
• Asynchronous HTTP Programming Model
• Client side templating in Scala
Play 2.0 Overview
• Web framework written in Java and Scala
• Not built on top of Servlet APIs
• Statically typed MVC Architecture
• Asynchronous HTTP Programming Model
• Client side templating in Scala
• Server side code in Java or Scala
Anatomy of a Play 2.0
    Application
 -app      App sources
 -conf     Configuration files
 -dist     Zip file deployed to Cloud Foundry
 -logs     Logs
 -project sbt project files
 -public   public assets( js, css)
 -target   Generated sources
MVC

• Model      : Domain Object Models map to a
  persistence store
• Views      :Rendered content using templates
• Controller : Routes Http requests using ActionS
Play Architecture

• Built as an extension of JBoss Netty Server
• All the requests are Asynch -- using nio
• Core Play is a pure Scala app which runs in
  a JVM
• Stateless on the Server side
Play Application at Runtime
Play App Support in
    Cloud Foundry

• Supports Play as one of the frameworks
• Auto-detected by vmc
• Support mysql and Postgres databases
Lifecycle of a Play app
   in CloudFoundry
 Install Play
Lifecycle of a Play app
    in CloudFoundry
     Install Play


Develop/Test Locally
Lifecycle of a Play app
    in CloudFoundry
     Install Play

                       $play new myapp
Develop/Test Locally   [myapp]$run
Lifecycle of a Play app
    in CloudFoundry
     Install Play

                       $play new myapp
Develop/Test Locally   [myapp]$run


 Deploy on Cloud
    Foundry
Lifecycle of a Play app
    in CloudFoundry
     Install Play

                       $play new myapp
Develop/Test Locally   [myapp]$run


 Deploy on Cloud       $vmc push --path=dist/
                       myapp.zip
    Foundry
Sample App
Todo List
App Structure : Router

         # Home page
         GET /                      controllers.Application.index()

         # Map static resources from the /public folder to the /assets URL
         path
         GET /assets/*file          controllers.Assets.at(path="/public", file)

         # Tasks
         GET /tasks             controllers.Application.tasks()
         POST /tasks            controllers.Application.newTask()
         POST /tasks/:id/delete controllers.Application.deleteTask(id: Long)
App Structure : Controller
          public class Application extends
                  Controller {
            public static Result index() {}

              public static Result tasks() {}

              public static Result newTask() {}

              public static Result deleteTask(
                Long id) {}

          }
App Structure : Model
       @Entity
       public class Task extends Model {

           @Id
           public Long id;

           @Required
           public String label;

           public static Finder<Long,Task>
             find = new Finder(...);

           public static void create(Task task)
       {
                  task.save();
              }
       }
AppStructure :View
 • Scala based template
 • Compiled into a scala function with render
   method

@(tasks: List[Task], taskForm: Form[Task])

@import helper._

@main("Todo list") {

    <h1>@tasks.size() task(s)</h1>
    ....
Create a Task
List all the Tasks
Delete a Task
Demo
Summary
Summary

• Play 2.0 takes a new approach to Web app
  development in Java world
Summary

• Play 2.0 takes a new approach to Web app
  development in Java world
• Simplifies the development cycle
Summary

• Play 2.0 takes a new approach to Web app
  development in Java world
• Simplifies the development cycle
• Frameworks should not fight HTTP but
  embrace it
Questions

Contenu connexe

Tendances

VMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - OverviewVMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - Overviewrajdeep
 
Openstack meetup-pune-aug22-overview
Openstack meetup-pune-aug22-overviewOpenstack meetup-pune-aug22-overview
Openstack meetup-pune-aug22-overviewrajdeep
 
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...Docker, Inc.
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetesKrishna-Kumar
 
The Operator Pattern - Managing Stateful Services in Kubernetes
The Operator Pattern - Managing Stateful Services in KubernetesThe Operator Pattern - Managing Stateful Services in Kubernetes
The Operator Pattern - Managing Stateful Services in KubernetesQAware GmbH
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to KubernetesRohman Muhamad
 
Intro to cluster scheduler for Linux containers
Intro to cluster scheduler for Linux containersIntro to cluster scheduler for Linux containers
Intro to cluster scheduler for Linux containersKumar Gaurav
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to KubernetesVishal Biyani
 
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...Brian Grant
 
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...Nati Shalom
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 
fabric8 ... and Docker, Kubernetes & OpenShift
fabric8 ... and Docker, Kubernetes & OpenShiftfabric8 ... and Docker, Kubernetes & OpenShift
fabric8 ... and Docker, Kubernetes & OpenShiftroland.huss
 
Dockerizing Windows Server Applications by Ender Barillas and Taylor Brown
Dockerizing Windows Server Applications by Ender Barillas and Taylor BrownDockerizing Windows Server Applications by Ender Barillas and Taylor Brown
Dockerizing Windows Server Applications by Ender Barillas and Taylor BrownDocker, Inc.
 
Clocker - The Docker Cloud Maker
Clocker - The Docker Cloud MakerClocker - The Docker Cloud Maker
Clocker - The Docker Cloud MakerAndrew Kennedy
 
Kubernetes intro public - kubernetes user group 4-21-2015
Kubernetes intro   public - kubernetes user group 4-21-2015Kubernetes intro   public - kubernetes user group 4-21-2015
Kubernetes intro public - kubernetes user group 4-21-2015reallavalamp
 
Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with KubernetesCarlos Sanchez
 
Container Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and KubernetesContainer Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and KubernetesWill Hall
 

Tendances (20)

VMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - OverviewVMware Hybrid Cloud Service - Overview
VMware Hybrid Cloud Service - Overview
 
Openstack meetup-pune-aug22-overview
Openstack meetup-pune-aug22-overviewOpenstack meetup-pune-aug22-overview
Openstack meetup-pune-aug22-overview
 
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
 
The Operator Pattern - Managing Stateful Services in Kubernetes
The Operator Pattern - Managing Stateful Services in KubernetesThe Operator Pattern - Managing Stateful Services in Kubernetes
The Operator Pattern - Managing Stateful Services in Kubernetes
 
Demystifying puppet
Demystifying puppetDemystifying puppet
Demystifying puppet
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
 
Intro to cluster scheduler for Linux containers
Intro to cluster scheduler for Linux containersIntro to cluster scheduler for Linux containers
Intro to cluster scheduler for Linux containers
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
 
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
 
Kubernetes Node Deep Dive
Kubernetes Node Deep DiveKubernetes Node Deep Dive
Kubernetes Node Deep Dive
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
fabric8 ... and Docker, Kubernetes & OpenShift
fabric8 ... and Docker, Kubernetes & OpenShiftfabric8 ... and Docker, Kubernetes & OpenShift
fabric8 ... and Docker, Kubernetes & OpenShift
 
Dockerizing Windows Server Applications by Ender Barillas and Taylor Brown
Dockerizing Windows Server Applications by Ender Barillas and Taylor BrownDockerizing Windows Server Applications by Ender Barillas and Taylor Brown
Dockerizing Windows Server Applications by Ender Barillas and Taylor Brown
 
Clocker - The Docker Cloud Maker
Clocker - The Docker Cloud MakerClocker - The Docker Cloud Maker
Clocker - The Docker Cloud Maker
 
What's New in Docker 1.12?
What's New in Docker 1.12?What's New in Docker 1.12?
What's New in Docker 1.12?
 
Kubernetes intro public - kubernetes user group 4-21-2015
Kubernetes intro   public - kubernetes user group 4-21-2015Kubernetes intro   public - kubernetes user group 4-21-2015
Kubernetes intro public - kubernetes user group 4-21-2015
 
Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with Kubernetes
 
Container Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and KubernetesContainer Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and Kubernetes
 

En vedette

Cloud Foundry Architecture and Overview
Cloud Foundry Architecture and OverviewCloud Foundry Architecture and Overview
Cloud Foundry Architecture and Overviewrajdeep
 
Bosh - Twenty Years of Deployment Lessons in One Tool
Bosh - Twenty Years of Deployment Lessons in One ToolBosh - Twenty Years of Deployment Lessons in One Tool
Bosh - Twenty Years of Deployment Lessons in One ToolVMware Tanzu
 
A year with Cloud Foundry and BOSH
A year with Cloud Foundry and BOSHA year with Cloud Foundry and BOSH
A year with Cloud Foundry and BOSHTroy Astle
 
Cloud infrastructures - Slide Set 6 - BOSH | anynines
Cloud infrastructures - Slide Set 6 - BOSH | anyninesCloud infrastructures - Slide Set 6 - BOSH | anynines
Cloud infrastructures - Slide Set 6 - BOSH | anyninesanynines GmbH
 
Deploy Cloud Foundry using bosh_bootstrap
Deploy Cloud Foundry using bosh_bootstrapDeploy Cloud Foundry using bosh_bootstrap
Deploy Cloud Foundry using bosh_bootstraprajdeep
 
Cloud Foundry にアプリケーションを push する際の典型的な10のエラー
Cloud Foundry にアプリケーションを push する際の典型的な10のエラーCloud Foundry にアプリケーションを push する際の典型的な10のエラー
Cloud Foundry にアプリケーションを push する際の典型的な10のエラーnota-ja
 
Cloud Foundry: Infrastructure Options
Cloud Foundry: Infrastructure OptionsCloud Foundry: Infrastructure Options
Cloud Foundry: Infrastructure OptionsAltoros
 
Code Signing with CPK
Code Signing with CPKCode Signing with CPK
Code Signing with CPKZhi Guan
 
Introduction to MidoNet
Introduction to MidoNetIntroduction to MidoNet
Introduction to MidoNetTaku Fukushima
 
Software Defined Environment - In one click get the Dev/QA/Staging Environment
Software Defined Environment - In one click get the Dev/QA/Staging EnvironmentSoftware Defined Environment - In one click get the Dev/QA/Staging Environment
Software Defined Environment - In one click get the Dev/QA/Staging EnvironmentVenu Murthy
 
RubyKaigi2014レポート
RubyKaigi2014レポートRubyKaigi2014レポート
RubyKaigi2014レポートgree_tech
 
Autoscaling Distributed System with BOSH (Cloud Foundry Summit 2014)
Autoscaling Distributed System with BOSH (Cloud Foundry Summit 2014)Autoscaling Distributed System with BOSH (Cloud Foundry Summit 2014)
Autoscaling Distributed System with BOSH (Cloud Foundry Summit 2014)VMware Tanzu
 
Monitor Cloud Foundry and Bosh with Prometheus
Monitor Cloud Foundry and Bosh with PrometheusMonitor Cloud Foundry and Bosh with Prometheus
Monitor Cloud Foundry and Bosh with PrometheusGwenn Etourneau
 
Cloud Foundry Summit 2015: Managing Multiple Cloud with a Single BOSH Deploym...
Cloud Foundry Summit 2015: Managing Multiple Cloud with a Single BOSH Deploym...Cloud Foundry Summit 2015: Managing Multiple Cloud with a Single BOSH Deploym...
Cloud Foundry Summit 2015: Managing Multiple Cloud with a Single BOSH Deploym...VMware Tanzu
 

En vedette (20)

Cloud Foundry Architecture and Overview
Cloud Foundry Architecture and OverviewCloud Foundry Architecture and Overview
Cloud Foundry Architecture and Overview
 
Bosh - Twenty Years of Deployment Lessons in One Tool
Bosh - Twenty Years of Deployment Lessons in One ToolBosh - Twenty Years of Deployment Lessons in One Tool
Bosh - Twenty Years of Deployment Lessons in One Tool
 
A year with Cloud Foundry and BOSH
A year with Cloud Foundry and BOSHA year with Cloud Foundry and BOSH
A year with Cloud Foundry and BOSH
 
Cloud infrastructures - Slide Set 6 - BOSH | anynines
Cloud infrastructures - Slide Set 6 - BOSH | anyninesCloud infrastructures - Slide Set 6 - BOSH | anynines
Cloud infrastructures - Slide Set 6 - BOSH | anynines
 
Deploy Cloud Foundry using bosh_bootstrap
Deploy Cloud Foundry using bosh_bootstrapDeploy Cloud Foundry using bosh_bootstrap
Deploy Cloud Foundry using bosh_bootstrap
 
The Berkshelf Way
The Berkshelf WayThe Berkshelf Way
The Berkshelf Way
 
Cloud foundry and openstackcloud
Cloud foundry and openstackcloudCloud foundry and openstackcloud
Cloud foundry and openstackcloud
 
Cloud Foundry にアプリケーションを push する際の典型的な10のエラー
Cloud Foundry にアプリケーションを push する際の典型的な10のエラーCloud Foundry にアプリケーションを push する際の典型的な10のエラー
Cloud Foundry にアプリケーションを push する際の典型的な10のエラー
 
Cloud Foundry: Infrastructure Options
Cloud Foundry: Infrastructure OptionsCloud Foundry: Infrastructure Options
Cloud Foundry: Infrastructure Options
 
MidoNet deep dive
MidoNet deep diveMidoNet deep dive
MidoNet deep dive
 
Code Signing with CPK
Code Signing with CPKCode Signing with CPK
Code Signing with CPK
 
Introduction to MidoNet
Introduction to MidoNetIntroduction to MidoNet
Introduction to MidoNet
 
Software Defined Environment - In one click get the Dev/QA/Staging Environment
Software Defined Environment - In one click get the Dev/QA/Staging EnvironmentSoftware Defined Environment - In one click get the Dev/QA/Staging Environment
Software Defined Environment - In one click get the Dev/QA/Staging Environment
 
RubyKaigi2014レポート
RubyKaigi2014レポートRubyKaigi2014レポート
RubyKaigi2014レポート
 
Gunosy.go #4 go
Gunosy.go #4 goGunosy.go #4 go
Gunosy.go #4 go
 
Autoscaling Distributed System with BOSH (Cloud Foundry Summit 2014)
Autoscaling Distributed System with BOSH (Cloud Foundry Summit 2014)Autoscaling Distributed System with BOSH (Cloud Foundry Summit 2014)
Autoscaling Distributed System with BOSH (Cloud Foundry Summit 2014)
 
Om
OmOm
Om
 
Monitor Cloud Foundry and Bosh with Prometheus
Monitor Cloud Foundry and Bosh with PrometheusMonitor Cloud Foundry and Bosh with Prometheus
Monitor Cloud Foundry and Bosh with Prometheus
 
Cloud Foundry Summit 2015: Managing Multiple Cloud with a Single BOSH Deploym...
Cloud Foundry Summit 2015: Managing Multiple Cloud with a Single BOSH Deploym...Cloud Foundry Summit 2015: Managing Multiple Cloud with a Single BOSH Deploym...
Cloud Foundry Summit 2015: Managing Multiple Cloud with a Single BOSH Deploym...
 
rtnetlink
rtnetlinkrtnetlink
rtnetlink
 

Similaire à Play Support in Cloud Foundry

eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introductionvstorm83
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Enginecatherinewall
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0Ido Flatow
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)slire
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The BasicsPhilip Langer
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Ido Flatow
 
Play Framework on Google App Engine
Play Framework on Google App EnginePlay Framework on Google App Engine
Play Framework on Google App EngineFred Lin
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technologyMinal Maniar
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Steven Smith
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot IntroductionJeevesh Pandey
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGuillaume Laforge
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Againjonknapp
 

Similaire à Play Support in Cloud Foundry (20)

eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
 
Play Framework on Google App Engine
Play Framework on Google App EnginePlay Framework on Google App Engine
Play Framework on Google App Engine
 
Os Haase
Os HaaseOs Haase
Os Haase
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
Arquitecturas de microservicios - Medianet Software
Arquitecturas de microservicios   -  Medianet SoftwareArquitecturas de microservicios   -  Medianet Software
Arquitecturas de microservicios - Medianet Software
 
Google App Engine overview (GAE/J)
Google App Engine overview (GAE/J)Google App Engine overview (GAE/J)
Google App Engine overview (GAE/J)
 
Intro to sbt-web
Intro to sbt-webIntro to sbt-web
Intro to sbt-web
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Session 2
Session 2Session 2
Session 2
 
Session 2
Session 2Session 2
Session 2
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Again
 

Plus de rajdeep

Aura Framework Overview
Aura Framework OverviewAura Framework Overview
Aura Framework Overviewrajdeep
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introductionrajdeep
 
Docker Architecture (v1.3)
Docker Architecture (v1.3)Docker Architecture (v1.3)
Docker Architecture (v1.3)rajdeep
 
virtualization-vs-containerization-paas
virtualization-vs-containerization-paasvirtualization-vs-containerization-paas
virtualization-vs-containerization-paasrajdeep
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Diverajdeep
 
Managing Activity Backstack
Managing Activity BackstackManaging Activity Backstack
Managing Activity Backstackrajdeep
 
Google cloud platform
Google cloud platformGoogle cloud platform
Google cloud platformrajdeep
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Enginerajdeep
 

Plus de rajdeep (8)

Aura Framework Overview
Aura Framework OverviewAura Framework Overview
Aura Framework Overview
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introduction
 
Docker Architecture (v1.3)
Docker Architecture (v1.3)Docker Architecture (v1.3)
Docker Architecture (v1.3)
 
virtualization-vs-containerization-paas
virtualization-vs-containerization-paasvirtualization-vs-containerization-paas
virtualization-vs-containerization-paas
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Dive
 
Managing Activity Backstack
Managing Activity BackstackManaging Activity Backstack
Managing Activity Backstack
 
Google cloud platform
Google cloud platformGoogle cloud platform
Google cloud platform
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
 

Play Support in Cloud Foundry

  • 1. Building Play 2.0 Applications on CloudFoundry Rajdeep Dua Director, DevRel VMware India @rajdeepdua
  • 3. For years PHP, Ruby developers have been laughing at Java developers every time they change and refresh the page
  • 4. ..and all of us evolve Grails JVM Servlets JEE Spring Play
  • 5. ..and all of us evolve Grails JVM Servlets JEE Spring Play
  • 6. Play doesn’t fight HTTP or the Browser
  • 7. Play doesn’t fight HTTP or the Browser Stateless, HTTP Centric, Easier development lifecycle
  • 9. Play 2.0 Overview • Web framework written in Java and Scala
  • 10. Play 2.0 Overview • Web framework written in Java and Scala • Not built on top of Servlet APIs
  • 11. Play 2.0 Overview • Web framework written in Java and Scala • Not built on top of Servlet APIs • Statically typed MVC Architecture
  • 12. Play 2.0 Overview • Web framework written in Java and Scala • Not built on top of Servlet APIs • Statically typed MVC Architecture • Asynchronous HTTP Programming Model
  • 13. Play 2.0 Overview • Web framework written in Java and Scala • Not built on top of Servlet APIs • Statically typed MVC Architecture • Asynchronous HTTP Programming Model • Client side templating in Scala
  • 14. Play 2.0 Overview • Web framework written in Java and Scala • Not built on top of Servlet APIs • Statically typed MVC Architecture • Asynchronous HTTP Programming Model • Client side templating in Scala • Server side code in Java or Scala
  • 15. Anatomy of a Play 2.0 Application -app App sources -conf Configuration files -dist Zip file deployed to Cloud Foundry -logs Logs -project sbt project files -public public assets( js, css) -target Generated sources
  • 16. MVC • Model : Domain Object Models map to a persistence store • Views :Rendered content using templates • Controller : Routes Http requests using ActionS
  • 17. Play Architecture • Built as an extension of JBoss Netty Server • All the requests are Asynch -- using nio • Core Play is a pure Scala app which runs in a JVM • Stateless on the Server side
  • 19. Play App Support in Cloud Foundry • Supports Play as one of the frameworks • Auto-detected by vmc • Support mysql and Postgres databases
  • 20. Lifecycle of a Play app in CloudFoundry Install Play
  • 21. Lifecycle of a Play app in CloudFoundry Install Play Develop/Test Locally
  • 22. Lifecycle of a Play app in CloudFoundry Install Play $play new myapp Develop/Test Locally [myapp]$run
  • 23. Lifecycle of a Play app in CloudFoundry Install Play $play new myapp Develop/Test Locally [myapp]$run Deploy on Cloud Foundry
  • 24. Lifecycle of a Play app in CloudFoundry Install Play $play new myapp Develop/Test Locally [myapp]$run Deploy on Cloud $vmc push --path=dist/ myapp.zip Foundry
  • 27. App Structure : Router # Home page GET / controllers.Application.index() # Map static resources from the /public folder to the /assets URL path GET /assets/*file controllers.Assets.at(path="/public", file) # Tasks GET /tasks controllers.Application.tasks() POST /tasks controllers.Application.newTask() POST /tasks/:id/delete controllers.Application.deleteTask(id: Long)
  • 28. App Structure : Controller public class Application extends Controller { public static Result index() {} public static Result tasks() {} public static Result newTask() {} public static Result deleteTask( Long id) {} }
  • 29. App Structure : Model @Entity public class Task extends Model { @Id public Long id; @Required public String label; public static Finder<Long,Task> find = new Finder(...); public static void create(Task task) { task.save(); } }
  • 30. AppStructure :View • Scala based template • Compiled into a scala function with render method @(tasks: List[Task], taskForm: Form[Task]) @import helper._ @main("Todo list") { <h1>@tasks.size() task(s)</h1> ....
  • 32. List all the Tasks
  • 34. Demo
  • 36. Summary • Play 2.0 takes a new approach to Web app development in Java world
  • 37. Summary • Play 2.0 takes a new approach to Web app development in Java world • Simplifies the development cycle
  • 38. Summary • Play 2.0 takes a new approach to Web app development in Java world • Simplifies the development cycle • Frameworks should not fight HTTP but embrace it

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n