Upload
jug-lausanne
View
178
Download
3
Embed Size (px)
DESCRIPTION
Play! chez Zaptravel - Nicolas Martignole - December 2012
Citation preview
Mise en oeuvre de Play 2 sur ZapTravel
ZapTravel
Mise en oeuvre de Play 2 sur un vrai projet de la
vraie vie, comme quoi on ne fait pas QUE des HelloWorld
ZapTravel
Embarquement dans un nouveau monde
ZapTravel
Si vous voulez développer avec plaisir
ZapTravel
Bref...
ZapTravel
ZapTravel
Web
Reactive Programming
Scala
Akka
Architecture
ZapTravel
ZapTravel
ZapTravel
• Innover dans la découverte et l’achat de voyages
• Avion + Hôtel + Voiture + Activités
• Temps réel
•Web + Mobile
ZapTravel
•Week-end romantique
ZapTravel
•Week-end romantique
•Golf ce weekend
• Shopping à Milan
• Ski + Spa pour se détendre
• Sites de l’Unesco et visites musées
ZapTravel
Confirmation prix en temps réel
Construire du contenu
dynamiquement
Pousser les prix vers le client
Gérer plusieurs flux de données
...
Web
Statique
Dynamique
Structuré
Temps réel
© babimu - Fotolia.com
Statique
Dynamique
Structuré
Temps réel
© M.studio - Fotolia.com
Statique
Dynamique
Structuré
Temps réel
© M.studio - Fotolia.com
Statique
Dynamique
Structuré
Temps réel
© Julien Eichinger - Fotolia.com
• Données structurées/liées
• Temps réel (Twitter)
• Personnalisée (Facebook, Amazon)
•Web mobile (Foursquare)
Quelques tendances
ZapTravel
ZapTravel
• Fournisseurs de données
ZapTravelArchitecture
Architecture
LB
Web
WebHTTPHTTPS
RedisAir/Hotel/Cars...
RedisWebuser/Reservatiom
RedisWeb content
S3
Photos
ZapTravel
Architecture
LB
Web
Web
Web
HTTPHTTPS
RedisAir/Hotel/Cars/Ac
RedisResa/Users
RedisWeb Content
Web
redis
ZapTravel
Architecture
HTTPHTTPS
RedisAir/Hotel/Cars/Ac
RedisResa/Users
RedisWeb Content
MySQL
Admin
Scrappers Tooling
Backoffice
Publishers
Crowd computing
ZapTravel
20 Gb
Architecture
HTTPHTTPS
RedisAir/Hotel/Cars/Ac
RedisResa/Users
RedisWeb Content
MySQL
PHP
PHP
PHP
Java
Java
PHP
Apache
ZapTravel
Demo
- Check time -
Un problème ?Client Serveur Service Avion Service Voiture
ZapTravel
Intégration de services
Serveur
Avion
Hotel
Voiture
Navigateur Web
ZapTravel
Intégration de services
Navigateur Web Serveur
Avion
Hotel
Voiture
ZapTravel
Intégration de services
Serveur
Avion
Hotel
Voiture
Navigateur Web
ZapTravel
ZapTravel
© Galyna Andrushko - Fotolia.com
Passer de l’autre côté
Play2
Solutions
• Système non bloquant (NIO)
ZapTravel
Solutions
•Modèle de programmation événementiel et réactif
ZapTravel
Solutions
• Serveur sans état conversationnel
ZapTravel
Solutions
• Streaming vers le client
ZapTravel
Non bloquant
Web client Serveur
Avion
Hotel
Voiture
ZapTravel
Réactif
Web client Serveur
Avion
Hotel
Voiture
ZapTravel
ConversationSans état conversationnel du
côté serveur
© lkunl - Fotolia.com
StreamingNo polling *
© Scanrail - Fotolia.com
WebBrowser -> ZapTravelZapTravel -> Service Providers
ZapTravel
Différence entre Streaming et REST
https://dev.twitter.com/docs/streaming-apis ZapTravel
Streaming API
ZapTravel
2012
Play 2
Scala
NoSQL
Play 1
Java
SQL
Play 2 en un slide• Modèle de
programmation événementiel
• Typage fort
• Moteur de templating
• Akka
• Moteur asynchrone
• Streaming
• NoSQL
• Puissance
• Framework fullstack
• existe-t-il une autre alternative ?
Scala
def index() = Action { val name ="Nicolas" Ok(views.html.Application.index(name)) }
Scala - 2@(name: String)
@myTemplate() {
<h1>Hello @name</h1> ... }
Mais pourquoi Scala ?
ZapTravel
Attention : FUD pendant quelques slides.
Le bon vieux développeur Java
ZapTravel
«...à la mode...»
ZapTravel
«... efficacité...»
ZapTravel
... pause pub ...
ZapTravel
Sérieusement
Choix de Scala
•Orienté objet ET Fonctionnel
• Typage statique
• JVM
•Collections
ZapTravel
Akka dans Play2
• Simple à mettre en oeuvre
• Facilité pour tester
• Indispensable pour ZapTravel
ZapTravel
http://zaptravel.com/romance/weekend-deals/from-london/to-anywhere/next-90days/quality/folio
ZapTravel
http://zaptravel.com/romance/weekend-deals/from-london/to-paris/11-Jan-2013-to-13-Jan-2013/best-western-sevres-montparnasse
ZapTravel
DemoQuestions
@nmartignole