playframework, realtime web...playframework the play framework makes it easier to build web...
TRANSCRIPT
![Page 1: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/1.jpg)
Playframework, Realtime Web
Sadek DrobiEarle Casteldine
![Page 2: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/2.jpg)
Web Oriented Architectures
![Page 3: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/3.jpg)
Where are we now?
Exciting time to be in software development
Cloud, Distributed Computing, Data, Bigger Data, Big Data, Infinite Data, Functional Programming ...
![Page 4: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/4.jpg)
Object/Entity Oriented Programming
An object represents a business entity
Using getters and setter on that object manipulates database rows automatically
Enough to learn an ORM/Active Record to make a living
Very little problem solving
![Page 5: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/5.jpg)
Object/Entity Oriented Programming
![Page 6: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/6.jpg)
Then we rediscovered the importance of Data!
![Page 7: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/7.jpg)
Object/Entity Oriented Programming
![Page 8: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/8.jpg)
Object/Entity Oriented Programming
![Page 9: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/9.jpg)
Object/Entity Oriented Programming
![Page 10: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/10.jpg)
Object/Entity Oriented Programming
![Page 11: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/11.jpg)
New Era with new challenges
Analyzing big sets of data
Using several machines for computing and analyzing data
Integrating different sets of data in different formats
Handling lots of users requests
![Page 12: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/12.jpg)
Playframework
The Play framework makes it easier to build web applications with Java & Scala.
Play is based on a lightweight, stateless, web-friendly architecture for highly-scalable and realtime web applications
- thanks to its reactive model, based on Futures and Iteratee IO.
Play was born to live in the clouds.
![Page 13: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/13.jpg)
Demo
![Page 14: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/14.jpg)
Why another web framework?
1 User = 1 Thread
![Page 15: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/15.jpg)
Why another web framework?
Connections
![Page 16: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/16.jpg)
New Era with new challenges
Analyzing big sets of data
Using several machines for computing and analyzing data
Integrating different sets of data in different formats
Handling lots of users requests
![Page 17: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/17.jpg)
Playframework, for a new era with new challenges
Analyze big sets of data: Functional Programming, Collections, Data Structures
Using several machines for computing and analyzing data
Integrating different sets of data in different formats: Parsers, APIs and FP
Handling lots of users requests: Stateless Reactive Architecture
![Page 18: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/18.jpg)
Web apps integrating Distributed Computing
Use distributed computing
Aggregate results back as a single response to the user
Programming Model
![Page 19: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/19.jpg)
Scheduled Computations, Computations in the Future
How do we talk about these computations?How do we manipulate them?
![Page 20: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/20.jpg)
Scheduled Computations, Computations in the Future
Future[T]
![Page 21: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/21.jpg)
Scheduled Computations, Computations in the Future
![Page 22: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/22.jpg)
A Future
Represents a value that will be available in the Future (or a Failure)
Provides a way to be notified whenever the value is available (onComplete)
Has some nice composition properties
![Page 23: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/23.jpg)
A Future, nice properties
Future[Future[A]] => Future[A]
List[Future[A]] => Future[List[A]]
Future[A] => (A => B) => Future[B]
And a nice api with map, flatMap, filter, collect, recover, either and other higher order functions
![Page 24: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/24.jpg)
Using Futures for aggregating distributed computations
Context: Productivity tool used for discovery through data visualization
![Page 25: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/25.jpg)
Using Futures for aggregating distributed computations
Browser
Backend
Graph Service Data Service
![Page 26: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/26.jpg)
Demo
![Page 27: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/27.jpg)
Using Futures for aggregating distributed computations
waitAll kind of composition
We can do waitAny, waitEither, timeout, ...etc
You can compose all of these
![Page 28: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/28.jpg)
Using Futures for aggregating distributed computations
Context: Productivity tool used for discovery through data visualization
![Page 29: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/29.jpg)
Aggregating and streaming distributed computations
Browser
Backend
Graph Service Data Service
![Page 30: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/30.jpg)
Aggregating and streaming distributed computations
We need a protocol to send messages to the browser
We need a way to talk about Streams
How can we transform our list of computations into a Stream?
![Page 31: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/31.jpg)
On the browser
Comet, Server Sent Events, Websockets.
![Page 32: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/32.jpg)
How can we talk about Streams at the server side?
![Page 33: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/33.jpg)
Is this what we really need to deal with Streams?
}); // Send a single 'Hello!' message
out.write("Hello!"); }
![Page 34: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/34.jpg)
How can we talk about Streams on the server side?
Programming model
With nice properties
Compositional
![Page 35: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/35.jpg)
InputStream / OutputStream
But they lack composition properties, and they are blocking.
Did the industry move backwards?
![Page 36: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/36.jpg)
Iteratee[E,R]
Consumes chunks of type E
Eventually computes a value of type R
Fancy fold, you can pause!
![Page 37: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/37.jpg)
Iteratee[E,R]
Immutable state machine
Done(E,R)
Cont(E => Iteratee[E,R])
Error
![Page 38: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/38.jpg)
Iteratee[E,R], nice properties
Iteratee[E,Iteratee[E,R]] => Iteratee[E,R]
Future[Iteratee[E,R]] => Iteratee[E,R]
Iteratee[E,R] => (R => U) => Iteratee[E,U]
![Page 39: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/39.jpg)
Enumerator[E]
Iteratee[E,R] => Iteratee[E,R]
![Page 40: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/40.jpg)
Enumerator[E], nice properties
Enumerator[Enumerator[E]] => Enumerator[E]
Future[Enumerator[E]] => Enumerator[E]
and some nice functions
map, flatMap, interleave, compose, ...
![Page 41: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/41.jpg)
Aggregating and streaming distributed computations
Browser
Backend
Graph Service Data Service
![Page 42: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/42.jpg)
Demo
![Page 43: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/43.jpg)
Enumerator[E], Iteratee[E,R]
take, takeWhile, drop, dropWhile, buffer, collect, filter, map, scan, ...
![Page 44: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/44.jpg)
Infinite Data
Live streams of realtime Data
Queues, Storm, ...
With Iteratees, Enumerators, and Enumeratees
![Page 45: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/45.jpg)
Demo
![Page 46: Playframework, Realtime Web...Playframework The Play framework makes it easier to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly](https://reader034.vdocuments.net/reader034/viewer/2022051916/6007adc3a65aab11060c96ee/html5/thumbnails/46.jpg)
Questions?
● www.playframework.com
● Check and play with the provided samples
● Ask