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

Like this? Share it with your network

Share

Play 2: java et scala

on

  • 1,042 views

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

Statistics

Views

Total Views
1,042
Views on SlideShare
1,042
Embed Views
0

Actions

Likes
2
Downloads
6
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Play 2: java et scala Presentation 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