SlideShare a Scribd company logo
Web application development using Play
Framework (with Java)
Tehran JUG meeting February-2015
By: Saeed Zarinfam
History
 Play 1 Created By Guillaume Bort at Zengularity SA
in 2007
 Play 2 release in 2012 by Typesafe (rewrite using
Scala)
 Play 1 vs Play 2
 Part of Typesafe Activator
Introduction
• Inspired by Ruby on Rails and Django
• Run on JVM (use java library)
• MVC
• Stateless
• Hot code reloading (in development)
• Convention over configuration
• Lightweight
• Asynchronous and Non-blocking I/O
• Java 8 support
Architecture
• MVC architecture
• Netty as web server (no servlet container)
• Sbt as build tools (Ivy dependency manager)
• Stateless
Requirements
 Install Typesafe Activator (or sbt)

JDK 6 or later

activator new my-first-app play-java
 Open project in IDE (Eclipse and Intellij)

Run using
– command line (activator run)
– Activator console (activator)
– Activator UI (activator ui)
– Interactive Console (Only in Scala)
Activator UI
Project structure
• App
• Public
• Conf
• build.sbt
• Scala and Java
• ...
Route
• Scala syntax
• Optional parameters
• Reverse routing
• REST friendly
Controller
• Actions return Result
• Static method
• Use dependency injection (JSR 330 in Play 3)
• HTTP manipulation (body parsers)
– REST service (JSON and XML)
View
 Type safe template engine
 Scala Template (Twirl inspired by ASP.NET
Razor)
 Http form handling
Session
 Session data are not stored in the server
 Session data added to each subsequent HTTP
Request, using Cookie.
 Cookie are signed with a secret key so the
client can’t modify the cookie data or it will be
invalidated
 Use cache for sever side session data
Assets
 Public Assets
 WebJars
 Assets controller
 Etag

Gzip
 Caching
 Managed Assets
 CoffeeScript
 LESS CSS

Sbt-web plugins

js-engine plugin (able to execute plugins written to the Node API either
within the JVM via the excellent Trireme)
Hot code reloading (in
development)
 It is possible because Play is stateless and tightly integration between Play and sbt
 Classloader hierarchy manage by sbt

Tricky (You don't need JRebel)
 For each request reloader check if there's any code changes
 Compile changed codes
 remove the old application classloader
 create a new application classloader with the updated classes.
 restart application (only application, no need to restart the JVM)
Accessing Database
 JDBC
 JPA (2.0)
 Ebeans (default ORM)
 Database evolutions
 Connection Pool
 Transaction
 In-memory H2 database
Asynchronous
 Actions are asynchronous by default
 Each open connection does not need a thread
 application code should avoid blocking in
controllers
Other APIs

Integration with Akka

WebSockets and Comet sockets

Cache API

Internationalization

Interceptors

Filters(only in Scala)

JSON API (jackson)

XML API

Job scheduling (Using Akka)

Logging API (Logback)
Testing

Ready to use application stubs for test (several helper methods)

Junit

FEST assertions

Mock

Test every part of your application (router, action, controller and ...)

Testing with a browser using FluentLenium ( Selenium WebDriver
wrapper)
Plugins
 Several plugins
– Mail
– Open ID
– CRUD
– Security
Deployment
 Compile all class and assets in application
 Activator start
 Activator stage (without any dependency on Play)
 Activator dist (produces a ZIP file without any
dependency on Play)
 SBT Native Packager plugin(activator universal:package-
bin)
– MSI, OS X disk image, RPM, DEB and …
 Publishing to a Maven (or Ivy) repository
Scaleability
 Scale horizontally easily (using load balancer)
 Integrate with Akka clustring and remoting
features
 Asynchronous from bottom to top
Reactive

Play Iteratee library (Scala Library)

ReactiveMongo
Non-blocking
 ReturnPromise<Result>Promise<Result>
 Intensive computation will just be run on another thread
(thread pool in separate execution context ).
 The web client will be blocked while waiting for the
response, but nothing will be blocked on the server
‫تشکر‬
zarinfam.s@gmail.com
http://javabyab.com

More Related Content

What's hot (20)

Play framework
Play frameworkPlay framework
Play framework
Andrew Skiba
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
Philip Langer
 
Designing a play framework application
Designing a play framework applicationDesigning a play framework application
Designing a play framework application
VulcanMinds
 
Play Framework 2.5
Play Framework 2.5Play Framework 2.5
Play Framework 2.5
m-kurz
 
Why Play Framework is fast
Why Play Framework is fastWhy Play Framework is fast
Why Play Framework is fast
Legacy Typesafe (now Lightbend)
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeans
Ryan Cuprak
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with Gradle
Wei Chen
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
Ryan Cuprak
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
Ryan Cuprak
 
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSDeveloping Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Shekhar Gulati
 
Node.js vs Play Framework
Node.js vs Play FrameworkNode.js vs Play Framework
Node.js vs Play Framework
Yevgeniy Brikman
 
Getting Started with Java EE 7
Getting Started with Java EE 7Getting Started with Java EE 7
Getting Started with Java EE 7
Arun Gupta
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
Jeevesh Pandey
 
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
Matthew Groves
 
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Julian Robichaux
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
Trey Howard
 
Java EE 6 CDI Integrates with Spring & JSF
Java EE 6 CDI Integrates with Spring & JSFJava EE 6 CDI Integrates with Spring & JSF
Java EE 6 CDI Integrates with Spring & JSF
Jiayun Zhou
 
[143]Inside fuse deview 2016
[143]Inside fuse   deview 2016[143]Inside fuse   deview 2016
[143]Inside fuse deview 2016
NAVER D2
 
Angular beans
Angular beansAngular beans
Angular beans
Bessem Hmidi
 
Play vs Grails Smackdown - Devoxx France 2013
Play vs Grails Smackdown - Devoxx France 2013Play vs Grails Smackdown - Devoxx France 2013
Play vs Grails Smackdown - Devoxx France 2013
Matt Raible
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
Philip Langer
 
Designing a play framework application
Designing a play framework applicationDesigning a play framework application
Designing a play framework application
VulcanMinds
 
Play Framework 2.5
Play Framework 2.5Play Framework 2.5
Play Framework 2.5
m-kurz
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeans
Ryan Cuprak
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with Gradle
Wei Chen
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
Ryan Cuprak
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
Ryan Cuprak
 
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSDeveloping Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Shekhar Gulati
 
Getting Started with Java EE 7
Getting Started with Java EE 7Getting Started with Java EE 7
Getting Started with Java EE 7
Arun Gupta
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
Jeevesh Pandey
 
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
Matthew Groves
 
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Julian Robichaux
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
Trey Howard
 
Java EE 6 CDI Integrates with Spring & JSF
Java EE 6 CDI Integrates with Spring & JSFJava EE 6 CDI Integrates with Spring & JSF
Java EE 6 CDI Integrates with Spring & JSF
Jiayun Zhou
 
[143]Inside fuse deview 2016
[143]Inside fuse   deview 2016[143]Inside fuse   deview 2016
[143]Inside fuse deview 2016
NAVER D2
 
Play vs Grails Smackdown - Devoxx France 2013
Play vs Grails Smackdown - Devoxx France 2013Play vs Grails Smackdown - Devoxx France 2013
Play vs Grails Smackdown - Devoxx France 2013
Matt Raible
 

Viewers also liked (14)

Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and Scala
Yevgeniy Brikman
 
Formation Play! framework
Formation Play! frameworkFormation Play! framework
Formation Play! framework
Benoît Simard
 
Introduction à Play Framework 2
Introduction à Play Framework 2Introduction à Play Framework 2
Introduction à Play Framework 2
Samy Dindane
 
Play framework - Human Talks Grenoble - 12.02.2013
Play framework - Human Talks Grenoble - 12.02.2013Play framework - Human Talks Grenoble - 12.02.2013
Play framework - Human Talks Grenoble - 12.02.2013
Xavier NOPRE
 
Enib cours c.a.i. web - séance #5 : scala play! framework
Enib   cours c.a.i. web - séance #5 : scala play! frameworkEnib   cours c.a.i. web - séance #5 : scala play! framework
Enib cours c.a.i. web - séance #5 : scala play! framework
Horacio Gonzalez
 
O uso de frameworks em aplicações desktop baseadas na metodologia de desenvol...
O uso de frameworks em aplicações desktop baseadas na metodologia de desenvol...O uso de frameworks em aplicações desktop baseadas na metodologia de desenvol...
O uso de frameworks em aplicações desktop baseadas na metodologia de desenvol...
Rogério Batista
 
Vert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Vert.x - Tehran JUG meeting Aug-2014 - Saeed ZarinfamVert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Vert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Saeed Zarinfam
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack Implementation
Mert Çalışkan
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.x
Mariam Hakobyan
 
Play framework: lessons learned
Play framework: lessons learnedPlay framework: lessons learned
Play framework: lessons learned
Peter Hilton
 
Comparing JVM Web Frameworks - February 2014
Comparing JVM Web Frameworks - February 2014Comparing JVM Web Frameworks - February 2014
Comparing JVM Web Frameworks - February 2014
Matt Raible
 
DDS on the Web: Quick Recipes for Real-Time Web Applications
DDS on the Web: Quick Recipes for Real-Time Web ApplicationsDDS on the Web: Quick Recipes for Real-Time Web Applications
DDS on the Web: Quick Recipes for Real-Time Web Applications
Angelo Corsaro
 
Play Framework
Play FrameworkPlay Framework
Play Framework
Armaklan
 
Play : Premiers pas par l'exemple le 120613
Play : Premiers pas par l'exemple le 120613Play : Premiers pas par l'exemple le 120613
Play : Premiers pas par l'exemple le 120613
SOAT
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and Scala
Yevgeniy Brikman
 
Formation Play! framework
Formation Play! frameworkFormation Play! framework
Formation Play! framework
Benoît Simard
 
Introduction à Play Framework 2
Introduction à Play Framework 2Introduction à Play Framework 2
Introduction à Play Framework 2
Samy Dindane
 
Play framework - Human Talks Grenoble - 12.02.2013
Play framework - Human Talks Grenoble - 12.02.2013Play framework - Human Talks Grenoble - 12.02.2013
Play framework - Human Talks Grenoble - 12.02.2013
Xavier NOPRE
 
Enib cours c.a.i. web - séance #5 : scala play! framework
Enib   cours c.a.i. web - séance #5 : scala play! frameworkEnib   cours c.a.i. web - séance #5 : scala play! framework
Enib cours c.a.i. web - séance #5 : scala play! framework
Horacio Gonzalez
 
O uso de frameworks em aplicações desktop baseadas na metodologia de desenvol...
O uso de frameworks em aplicações desktop baseadas na metodologia de desenvol...O uso de frameworks em aplicações desktop baseadas na metodologia de desenvol...
O uso de frameworks em aplicações desktop baseadas na metodologia de desenvol...
Rogério Batista
 
Vert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Vert.x - Tehran JUG meeting Aug-2014 - Saeed ZarinfamVert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Vert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Saeed Zarinfam
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack Implementation
Mert Çalışkan
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.x
Mariam Hakobyan
 
Play framework: lessons learned
Play framework: lessons learnedPlay framework: lessons learned
Play framework: lessons learned
Peter Hilton
 
Comparing JVM Web Frameworks - February 2014
Comparing JVM Web Frameworks - February 2014Comparing JVM Web Frameworks - February 2014
Comparing JVM Web Frameworks - February 2014
Matt Raible
 
DDS on the Web: Quick Recipes for Real-Time Web Applications
DDS on the Web: Quick Recipes for Real-Time Web ApplicationsDDS on the Web: Quick Recipes for Real-Time Web Applications
DDS on the Web: Quick Recipes for Real-Time Web Applications
Angelo Corsaro
 
Play Framework
Play FrameworkPlay Framework
Play Framework
Armaklan
 
Play : Premiers pas par l'exemple le 120613
Play : Premiers pas par l'exemple le 120613Play : Premiers pas par l'exemple le 120613
Play : Premiers pas par l'exemple le 120613
SOAT
 
Ad

Similar to Web application development using Play Framework (with Java) (20)

Play Framework Introduction
Play Framework IntroductionPlay Framework Introduction
Play Framework Introduction
m-kurz
 
Play Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level OverviewPlay Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level Overview
Josh Padnick
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
vstorm83
 
An Introduction to Play 2 Framework
An Introduction to Play 2 FrameworkAn Introduction to Play 2 Framework
An Introduction to Play 2 Framework
PT.JUG
 
Silicon Valley Code Camp 2011: Play! as you REST
Silicon Valley Code Camp 2011: Play! as you RESTSilicon Valley Code Camp 2011: Play! as you REST
Silicon Valley Code Camp 2011: Play! as you REST
Manish Pandit
 
How to Play at Work - A Play Framework Tutorial
How to Play at Work - A Play Framework TutorialHow to Play at Work - A Play Framework Tutorial
How to Play at Work - A Play Framework Tutorial
AssistSoftware
 
Play 2 Java Framework with TDD
Play 2 Java Framework with TDDPlay 2 Java Framework with TDD
Play 2 Java Framework with TDD
Basav Nagur
 
Play2 Java
Play2 JavaPlay2 Java
Play2 Java
XP Conference India
 
Play 2.0
Play 2.0Play 2.0
Play 2.0
elizhender
 
[Start] Playing
[Start] Playing[Start] Playing
[Start] Playing
佑介 九岡
 
How we use the play framework
How we use the play frameworkHow we use the play framework
How we use the play framework
Itai Gilo
 
Let's Play- Overview
Let's Play- OverviewLet's Play- Overview
Let's Play- Overview
benewu
 
Typesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayTypesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and Play
Luka Zakrajšek
 
Play Framework
Play FrameworkPlay Framework
Play Framework
Harinath Krishnamoorthy
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
rajdeep
 
Intoduction to Play Framework
Intoduction to Play FrameworkIntoduction to Play Framework
Intoduction to Play Framework
Knoldus Inc.
 
Developing web apps using Java and the Play framework
Developing web apps using Java and the Play frameworkDeveloping web apps using Java and the Play framework
Developing web apps using Java and the Play framework
Victor Porof
 
Scala play-framework
Scala play-frameworkScala play-framework
Scala play-framework
Abdhesh Kumar
 
Play - ein effizientes Webframework mit Spaßfaktor
Play - ein effizientes Webframework mit SpaßfaktorPlay - ein effizientes Webframework mit Spaßfaktor
Play - ein effizientes Webframework mit Spaßfaktor
leanovate GmbH
 
Play framework And Google Cloud Platform GCP.
Play framework And Google Cloud Platform GCP.Play framework And Google Cloud Platform GCP.
Play framework And Google Cloud Platform GCP.
Eng Chrispinus Onyancha
 
Play Framework Introduction
Play Framework IntroductionPlay Framework Introduction
Play Framework Introduction
m-kurz
 
Play Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level OverviewPlay Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level Overview
Josh Padnick
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
vstorm83
 
An Introduction to Play 2 Framework
An Introduction to Play 2 FrameworkAn Introduction to Play 2 Framework
An Introduction to Play 2 Framework
PT.JUG
 
Silicon Valley Code Camp 2011: Play! as you REST
Silicon Valley Code Camp 2011: Play! as you RESTSilicon Valley Code Camp 2011: Play! as you REST
Silicon Valley Code Camp 2011: Play! as you REST
Manish Pandit
 
How to Play at Work - A Play Framework Tutorial
How to Play at Work - A Play Framework TutorialHow to Play at Work - A Play Framework Tutorial
How to Play at Work - A Play Framework Tutorial
AssistSoftware
 
Play 2 Java Framework with TDD
Play 2 Java Framework with TDDPlay 2 Java Framework with TDD
Play 2 Java Framework with TDD
Basav Nagur
 
How we use the play framework
How we use the play frameworkHow we use the play framework
How we use the play framework
Itai Gilo
 
Let's Play- Overview
Let's Play- OverviewLet's Play- Overview
Let's Play- Overview
benewu
 
Typesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayTypesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and Play
Luka Zakrajšek
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
rajdeep
 
Intoduction to Play Framework
Intoduction to Play FrameworkIntoduction to Play Framework
Intoduction to Play Framework
Knoldus Inc.
 
Developing web apps using Java and the Play framework
Developing web apps using Java and the Play frameworkDeveloping web apps using Java and the Play framework
Developing web apps using Java and the Play framework
Victor Porof
 
Scala play-framework
Scala play-frameworkScala play-framework
Scala play-framework
Abdhesh Kumar
 
Play - ein effizientes Webframework mit Spaßfaktor
Play - ein effizientes Webframework mit SpaßfaktorPlay - ein effizientes Webframework mit Spaßfaktor
Play - ein effizientes Webframework mit Spaßfaktor
leanovate GmbH
 
Play framework And Google Cloud Platform GCP.
Play framework And Google Cloud Platform GCP.Play framework And Google Cloud Platform GCP.
Play framework And Google Cloud Platform GCP.
Eng Chrispinus Onyancha
 
Ad

Recently uploaded (20)

Generative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its ApplicationsGenerative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its Applications
SandeepKS52
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdfdp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Artificial Intelligence Applications Across Industries
Artificial Intelligence Applications Across IndustriesArtificial Intelligence Applications Across Industries
Artificial Intelligence Applications Across Industries
SandeepKS52
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Software Testing & it’s types (DevOps)
Software  Testing & it’s  types (DevOps)Software  Testing & it’s  types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
FME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable InsightsFME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable Insights
Safe Software
 
Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025
Orangescrum
 
Key AI Technologies Used by Indian Artificial Intelligence Companies
Key AI Technologies Used by Indian Artificial Intelligence CompaniesKey AI Technologies Used by Indian Artificial Intelligence Companies
Key AI Technologies Used by Indian Artificial Intelligence Companies
Mypcot Infotech
 
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free DownloadWondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
WSO2
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3
Gaurav Sharma
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Providing Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better DataProviding Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better Data
Safe Software
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native BarcelonaOpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - IntroductionIBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlowDevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
wAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptxwAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptx
SimonedeGijt
 
Who will create the languages of the future?
Who will create the languages of the future?Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Automating Map Production With FME and Python
Automating Map Production With FME and PythonAutomating Map Production With FME and Python
Automating Map Production With FME and Python
Safe Software
 
Generative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its ApplicationsGenerative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its Applications
SandeepKS52
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdfdp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Artificial Intelligence Applications Across Industries
Artificial Intelligence Applications Across IndustriesArtificial Intelligence Applications Across Industries
Artificial Intelligence Applications Across Industries
SandeepKS52
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Software Testing & it’s types (DevOps)
Software  Testing & it’s  types (DevOps)Software  Testing & it’s  types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
FME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable InsightsFME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable Insights
Safe Software
 
Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025
Orangescrum
 
Key AI Technologies Used by Indian Artificial Intelligence Companies
Key AI Technologies Used by Indian Artificial Intelligence CompaniesKey AI Technologies Used by Indian Artificial Intelligence Companies
Key AI Technologies Used by Indian Artificial Intelligence Companies
Mypcot Infotech
 
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free DownloadWondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
WSO2
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3
Gaurav Sharma
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Providing Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better DataProviding Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better Data
Safe Software
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native BarcelonaOpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - IntroductionIBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlowDevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
wAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptxwAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptx
SimonedeGijt
 
Who will create the languages of the future?
Who will create the languages of the future?Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Automating Map Production With FME and Python
Automating Map Production With FME and PythonAutomating Map Production With FME and Python
Automating Map Production With FME and Python
Safe Software
 

Web application development using Play Framework (with Java)

  • 1. Web application development using Play Framework (with Java) Tehran JUG meeting February-2015 By: Saeed Zarinfam
  • 2. History  Play 1 Created By Guillaume Bort at Zengularity SA in 2007  Play 2 release in 2012 by Typesafe (rewrite using Scala)  Play 1 vs Play 2  Part of Typesafe Activator
  • 3. Introduction • Inspired by Ruby on Rails and Django • Run on JVM (use java library) • MVC • Stateless • Hot code reloading (in development) • Convention over configuration • Lightweight • Asynchronous and Non-blocking I/O • Java 8 support
  • 4. Architecture • MVC architecture • Netty as web server (no servlet container) • Sbt as build tools (Ivy dependency manager) • Stateless
  • 5. Requirements  Install Typesafe Activator (or sbt)  JDK 6 or later  activator new my-first-app play-java  Open project in IDE (Eclipse and Intellij)  Run using – command line (activator run) – Activator console (activator) – Activator UI (activator ui) – Interactive Console (Only in Scala)
  • 7. Project structure • App • Public • Conf • build.sbt • Scala and Java • ...
  • 8. Route • Scala syntax • Optional parameters • Reverse routing • REST friendly
  • 9. Controller • Actions return Result • Static method • Use dependency injection (JSR 330 in Play 3) • HTTP manipulation (body parsers) – REST service (JSON and XML)
  • 10. View  Type safe template engine  Scala Template (Twirl inspired by ASP.NET Razor)  Http form handling
  • 11. Session  Session data are not stored in the server  Session data added to each subsequent HTTP Request, using Cookie.  Cookie are signed with a secret key so the client can’t modify the cookie data or it will be invalidated  Use cache for sever side session data
  • 12. Assets  Public Assets  WebJars  Assets controller  Etag  Gzip  Caching  Managed Assets  CoffeeScript  LESS CSS  Sbt-web plugins  js-engine plugin (able to execute plugins written to the Node API either within the JVM via the excellent Trireme)
  • 13. Hot code reloading (in development)  It is possible because Play is stateless and tightly integration between Play and sbt  Classloader hierarchy manage by sbt  Tricky (You don't need JRebel)  For each request reloader check if there's any code changes  Compile changed codes  remove the old application classloader  create a new application classloader with the updated classes.  restart application (only application, no need to restart the JVM)
  • 14. Accessing Database  JDBC  JPA (2.0)  Ebeans (default ORM)  Database evolutions  Connection Pool  Transaction  In-memory H2 database
  • 15. Asynchronous  Actions are asynchronous by default  Each open connection does not need a thread  application code should avoid blocking in controllers
  • 16. Other APIs  Integration with Akka  WebSockets and Comet sockets  Cache API  Internationalization  Interceptors  Filters(only in Scala)  JSON API (jackson)  XML API  Job scheduling (Using Akka)  Logging API (Logback)
  • 17. Testing  Ready to use application stubs for test (several helper methods)  Junit  FEST assertions  Mock  Test every part of your application (router, action, controller and ...)  Testing with a browser using FluentLenium ( Selenium WebDriver wrapper)
  • 18. Plugins  Several plugins – Mail – Open ID – CRUD – Security
  • 19. Deployment  Compile all class and assets in application  Activator start  Activator stage (without any dependency on Play)  Activator dist (produces a ZIP file without any dependency on Play)  SBT Native Packager plugin(activator universal:package- bin) – MSI, OS X disk image, RPM, DEB and …  Publishing to a Maven (or Ivy) repository
  • 20. Scaleability  Scale horizontally easily (using load balancer)  Integrate with Akka clustring and remoting features  Asynchronous from bottom to top
  • 21. Reactive  Play Iteratee library (Scala Library)  ReactiveMongo
  • 22. Non-blocking  ReturnPromise<Result>Promise<Result>  Intensive computation will just be run on another thread (thread pool in separate execution context ).  The web client will be blocked while waiting for the response, but nothing will be blocked on the server