Your SlideShare is downloading. ×
Play 2: java et scala
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Play 2: java et scala

619
views

Published on

Retour d'expérience sur l'utilisation des deux langages au sein du framework

Retour d'expérience sur l'utilisation des deux langages au sein du framework

Published in: Technology

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
619
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Play 2: Java ET ScalaPour le meilleur et pour le pire@blouerat
  • 2. Bastien LOUËRAT@bloueratDéveloppeur @ Clever CloudHébergement PlayDéveloppement :Play 1, Play 2 Scala & Java
  • 3. Play 2: Java ET ScalaComment les deuxtechnologies semarient-elles ?Problèmes rencontrésen passant de Scalaà Java.
  • 4. The High VelocityWeb FrameworkFor Java and Scala
  • 5. HistoriquePlay 1.x:○ 2007: Projet interne @ Zenexity.○ 2009: Open Sourcing. 1.0 release.○ 2010: Play 1.1 (Netty, Async WS, Scala, Future)○ 2011: Play 1.2 (Ivy, WebSockets, play.libs.F,Promise<T>, await)○ Décembre 2011: 1.2.4, fork yalp. Dev Play 2Play 2.x○ 2012: Play 2.0, Typesafe stack 2. Scala, Akka & sbt○ 2013: Play 2.1, Scala 2.10, scala.concurrent.Future
  • 6. 1 framework, 2 APIs
  • 7. Controllers
  • 8. # Default path will just redirect to the computer listGET / controllers.Application.index# Computers list (look at the default values for pagination parameters)GET /computers controllers.Application.list(p:Int ?= 0, s:Int ?= 2, f ?= "")# Add computerGET /computers/new controllers.Application.createPOST /computers controllers.Application.save# Edit existing computerGET /computers/:id controllers.Application.edit(id:Long)POST /computers/:id controllers.Application.update(id:Long)VERB route reverseRouting
  • 9. Vues
  • 10. ● "You don’t have to write complicated Scalacode here" – Play for Java developpers● @foo.bar != @{foo.`type`}● error: No implicit Orderingdefined for Foofoos.sortedVues
  • 11. "We simply want tooffer a minimal setof helpers"Bases SQL
  • 12. ● Anorm par défaut. Minimal. Léger.« Parfait pour les ptites faims »● Slick by Typesafe. Verbeux sans macro.Bases SQL - Scala
  • 13. ● Ebean. Très léger. Génère mauvais DDLpour évolution.● JPA.○ Hibernate 4.0 (conversion JodaTime)○ Import du module javaJpa○ @Transactionnal & AkkaBases SQL - Java
  • 14. Formulaires - côté vueReverse router{HelpersHtml classique
  • 15. public class User {@Requiredpublic String email;public String password;public String validate() {if(authenticate(email,password) == null) {return "Invalid email or password";}return null;}}:):(Formulaires - côté modèles
  • 16. Exécution Asynchrone - Scala
  • 17. Exécution Asynchrone - Java
  • 18. Simple Build Tool● Build.scala● Très bonne documentation● Maven SNAPSHOT via SSH● Build system…
  • 19. play4allPlay with us!Auto-scalabilité / Supervision / Services
  • 20. THATS ALL FOLKS!@blouerat