ããã«ã¡ã¯ãã¨ã ã¹ãªã¼ã¨ã³ã¸ãã¢ãªã³ã°ã°ã«ã¼ãã§Scalaã¨ããããã好ããªå®æ±ã§ããä»åã¯ç§ãæå±ãã¦ãã製è¬ä¼æ¥åããã©ãããã©ã¼ã ãã¼ã ã®Play製ãããã¯ãã®Play/Scalaãã¼ã¸ã§ã³ã¢ããã®ã話ã§ããå½åPlay2.8ã«ãã¼ã¸ã§ã³ã¢ãããã¦ããã®ã§ããããã®æä¸ã«Play2.9/Play3.0ãScala LTSãåºããããã¾ãããæçµçã«Play3.0/Scala3.3ã«ãã¼ã¸ã§ã³ã¢ããã§ãã¦æ¬çªç¨¼åã§ãããµã¼ãã¹ãããã®ã§ããã®ãã¼ã¸ã§ã³ã¢ããã®çµç·¯ããç´¹ä»ãã¾ãã
Play2.8ã¸ã®éã®ã
2021å¹´ã®å¾æãããæå±ãã¼ã ã§ã®Play製ãµã¼ãã¹ã®ãã¼ã¸ã§ã³ã¢ãããå§ã¾ãã¾ããããã¼ã ã«ã¯3ã¤ã®Play製ãµã¼ãã¹ãããããã®æã®ãã¼ã¸ã§ã³ã¯æ¬¡ã®éãã§ããã
ãµã¼ãã¹ | Play | Scala | åè |
---|---|---|---|
A | 2.7 | 2.11 | ãµã¼ãã¹Bã®RESTã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªã«ä¾å |
B | 2.5 | 2.11 | |
C | 2.3 | 2.11 |
ãµã¼ãã¹Aã¯æ¯è¼çæ¹ä¿®ãå ¥ããããPlayã®ãã¼ã¸ã§ã³ãä¸ãã£ã¦ãã¾ããããããããµã¼ãã¹Aã¯ãµã¼ãã¹Bã«ä¾åãã¦ããããµã¼ãã¹BãScala2.11ã ã£ãããããµã¼ãã¹BãPlay2.8ã«ä¸ããªããã°ãµã¼ãã¹Aã®Playããã¼ã¸ã§ã³ã¢ãããããã¨ãã§ãã¾ããã
ãµã¼ãã¹Cã¯ã¨ã¦ãå®å®ãã¦ãããè¯ããæªããæ¹ä¿®ãå ¥ãããPlayã®ãã¼ã¸ã§ã³ã2.3ã§æ¢ã¾ã£ã¦ãã¾ãããå¼ç¤¾ã¯GitLabã使ã£ã¦ãã¾ãããGitLab CIãªã©ã®ä»çµã¿ããªããPlayã®ãã¼ã¸ã§ã³ã¢ãã以å¤ã«ãæ¹åãã¹ãç®æãããããããã¾ããã
ãµã¼ãã¹Bã¨Cã¯ãªã³ãã¬ã§åãã¦ããããµã¼ãã¼ã®Javaã®ãã¼ã¸ã§ã³ãªã©ãå¤ãã¾ã¾ã§ãããsbtãå¤ããä¾åã©ã¤ãã©ãªè§£æ±ºã«ivyã使ããã¦ç°å¢æ§ç¯ã«30åããã£ã¦ããããã¾ãããã¨ã«ããããããªãã®ãå¤ãã¦æ¹åã®ãããã®ãããµã¼ãã¹ãã¡ãæã£ã¦ãã¾ããã
2023å¹´8æãæçµçã«ããã3ã¤ã®ãµã¼ãã¹ã¯Play2.8/Scala2.13/Java11/sbt1.7ã«æ´æ°ãã¾ããããã¹ã¦ã¯ã©ã¦ãã§åä½ããGitLab CIã§ãããã¤ã§ããããã«ãªãã¾ããã
Play3.0ã¸ã®ãã¼ã¸ã§ã³ã¢ãã
2022å¹´9æãPlayçéã«è¡æãèµ°ãã¾ããPlayå é¨ã§ä½¿ã£ã¦ããAkkaã®ã©ã¤ã»ã³ã¹ãBCLã«å¤æ´ããã¾ãããPlayè¶ãã«Akkaã使ãå ´åã¯ç¹ä¾ãé©ç¨ããããã¨ã«ãªã£ã¦ãã¾ããããæçµçã«ã¯Akkaã使ããªãPlay3.0ã®éçºãéå§ããã¾ãããããã¦2023å¹´11æã«Play3.0ããªãªã¼ã¹ããã¾ãããPlay3.0ã¯Akkaãããã©ã¼ã¯ããPekkoã¨ããã©ã¤ãã©ãªã使ãããã«ãªãã¾ãããã¾ããAkkaã使ãPlay2ç³»ã¯ã¡ã³ããã³ã¹ãåæ¢ããããã¨ãæ¤è¨ããã¦ããããã§ãã
ã¾ãã2023å¹´5æã«ã¯Scalaåã®LTSãã¼ã¸ã§ã³ã§ããScala3.3ããªãªã¼ã¹ããã¾ãããScalaã¯3ç³»ã«ãªã£ã¦ãã¼ã¸ã§ã³äºææ§ãããªãåä¸ãã¾ããããå ãã¦é·æãµãã¼ããã¼ã¸ã§ã³ãæä¾ããããã¨ã«ãã£ã¦ãããå®å®ãã¦å©ç¨ãããã¨ãå¯è½ã«ãªãã¾ããã
ãã®ãããPlayã¦ã¼ã¶ã¼ã¨ãã¦ã¯ã§ããã ãPlay3.0/Scala3.3ã«ãã¼ã¸ã§ã³ã¢ãããããã¨ããã§ããããããªãããã®éã®ãã«ã¯ããããã¤ã³ããããã¾ããã以ä¸ã§ãã®æ¦è¦ãç´¹ä»ãã¾ãã
ããã1ï¼ä¾åã©ã¤ãã©ãªãPlay2ç³»ã«ä¾åãã¦ãã
Play2ç³»ã¨Play3ç³»ã§ã¯groupId(package)ãcom.typesafe.play
ããorg.playframework
ã«å¤ããã¾ããããã®ãããã©ã¤ãã©ãªãç¹å®ã®Playã®ã¯ã©ã¹ã«ä¾åããããã«ãªã£ã¦ããã¨ãå®è¡æã¨ã©ã¼ãçºçããå¯è½æ§ãããã¾ãã
ãããã£ã¦ãPlayã«ä¾åãã¦ããã©ã¤ãã©ãªã使ç¨ããå ´åããã®ã©ã¤ãã©ãªã®Play3対å¿ãå¿ é ã«ãªãã¾ããããããªãããã®ã©ã¤ãã©ãªãPlay2ç³»ã§æ´æ°ãæ¢ã¾ã£ã¦ãã¾ã£ã¦ããå ´åã¯ããã®ã©ã¤ãã©ãªãä¾åãã¦ããPlayã®ãã¼ã¸ã§ã³ãä¸ãããããã®ã©ã¤ãã©ãªã使ããã«ãã¸ãã¯ãå¤æ´ããå¿ è¦ãããã¾ãã
ä»åã社å ã©ã¤ãã©ãªãmemcachedã©ã¤ãã©ãªãPlay2ç³»ã®ã¾ã¾ã ã£ãã®ã§ãããã«ä¾åãããµã¼ãã¹Bã¨ãµã¼ãã¹Cã¯Play3.0ã«ãã¼ã¸ã§ã³ã¢ããã§ãã¾ããã§ããããµã¼ãã¹Aã¯json4sã©ã¤ãã©ãªã使ã£ã¦ãã¾ããããéãã©ã¤ãã©ãªã使ããã¨ã§åé¿ãã¾ãããçµæããµã¼ãã¹Aã«ã¤ãã¦ã¯Play3.0ãã¼ã¸ã§ã³ã¢ãããå®æ½ã§ããããã«ãªãã¾ããã
ããã2ï¼ScalikeJDBCã®ä¾åé¢ä¿
ãµã¼ãã¹Aã¯ScalikeJDBCã使ç¨ãã¦ãã¾ãããPlayã¨ã¨ãã«ScalikeJDBCã使ç¨ãã¦ããå ´åãPlay/Scalaã®ãã¼ã¸ã§ã³ã®çµã¿åãããéå®ããã¾ããå ·ä½çã«ã¯æ¬¡ã®è¡¨ã«ãªãã¾ãã
Play | Scala | å©ç¨å¯è½ãªScalikeJDBC |
---|---|---|
2.9 | 2.13 | 3.5 |
2.9 | 3.3 | 4.0 |
3.0 | 2.13 | ãªã |
3.0 | 3.3 | 4.2 |
ããªããã®çµã¿åããã¯ãPlayã¨ScalikeJDBCãä¾åããscala-parser-combinatorsã¨ããä¾åã©ã¤ãã©ãªã®ã¡ã¸ã£ã¼ãã¼ã¸ã§ã³ãé£ãéãçµæãçºçãã¾ããscala-parser-combinatorsã®ãã¼ã¸ã§ã³ãã©ã¡ããã«åããã¦åé¿ã§ãã¾ããããã®å ´åã¯ä¸æ¹ã®ã©ã¤ãã©ãªã®ãã¹ããéã£ã¦ããªããã¨ã«çæãã¾ãããã
å¯è½ãªéãæ¤è¨¼æ¸ã¿ã®ã³ã¼ããå©ç¨ããããã«ãå©ç¨å¯è½ãªScalikeJDBCã使ããçµã¿åããã§ãã¼ã¸ã§ã³ã¢ããããè¨ç»ãç«ã¦ã¾ãããå ·ä½çã«ã¯æ¬¡ã®ãããªããã¼ã«ãªãã¾ããã
- Play2.8/Scala2.13/ScalikeJDBC3.5
- Play2.9/Scala2.13/ScalikeJDBC3.5 (Play2.8 â Play2.9)
- Play2.9/Scala3.3/ScalikeJDBC4.0 (Scala2.13 â Scala3.3)
- Play3.0/Scala3.3/ScalikeJDBC4.2 (Play2.9 â Play3.0)
ããã3ï¼ãµã¼ãã¼ããã¯ã¨ã³ãã®å¤æ´
Play2ç³»ã¯Akkaãã¼ã¹ã§ãããæ¢åãµã¼ãã¹ã¯ãµã¼ãã¼ããã¯ã¨ã³ããAkka HTTPã使ã£ã¦ãã¾ãããããããPlay2ç³»ã使ã£ã¦ããAkkaã¯Scala3対å¿ãã¦ãã¾ããããã®ãããPlay2.9ã§ã¯Akka/Akka HTTPãScala3ã§ãåããããã®ããã¯ãå°å ¥ããã¦ãã¾ãã
ä»åã¯ããã®ããã¯ãå©ç¨ããã«ãµã¼ãã¼ããã¯ã¨ã³ããAkka HTTPããNettyã«å¤æ´ãã¾ããããã ããPlay3.0/Scala3.3ã®ã¿ã¤ãã³ã°ã§Pekko HTTPã«å¤æ´ãã¦ãã¾ãã
- Play2.8/Scala.2.13/Akka HTTP
- Play2.9/Scala2.13/Akka HTTP
- Play2.9/Scala3.3/Netty
- Play3.0/Scala3.3/Pekko HTTP
ããã4ï¼sttpã®ããã¯ã¨ã³ãã®å¤æ´
ä»åã®ãµã¼ãã¹ã§ã¯å¤é¨ãµã¼ãã¹ã®REST APIå¼ã³åºãã®ããã«sttpãå©ç¨ãã¦ãã¾ãããPlay2.9ããPlay3.0ã¸ãã¼ã¸ã§ã³ã¢ããããã¿ã¤ãã³ã°ã§ãsttpã«é¢é£ãããã°ã«ééãã¾ãããããã¯ã¨ã³ãã«AsyncHttpClientFutureBackend
ã使ã£ã¦ããã¨ãããPlay3.0ã ã¨ã¨ããã¯ã©ã¹ï¼com.typesafe.netty.HandlerPublisher
ï¼ãè¦ã¤ãããªããã¨ããã¨ã©ã¼ãçºçãã¾ããã
Play+sttpã®æå°æ§æããã¸ã§ã¯ãã§åç¾ã§ããªãã£ããã¨ãsttpã®æ¬¡æããã¯ã¨ã³ãã§ã¯HandlerPublisher
ã使ãããªããã¨ãsttpã¯ããã¯ã¨ã³ãã«Pekkoãå©ç¨ã§ãããã¨ãªã©ããããã®ä¸å
·åã®æ ¹æ¬è§£æ±ºã¯ããã«ãPekkoã®ããã¯ã¨ã³ãã«åãæ¿ãããã¨ã§åé¿ãã¾ããã
ããã5ï¼ifå¼ãå¤ãè¿ããªã
Scala2ããScala3ã¸ã®å¤æ´ç¹ã®ä¸ã¤ã«ãelseå¥ãæããªãifå¼ãå¤ãè¿ããªãã¨ããã®ãããã¾ãããã®æåã«ä¾åãã¦ããå ´åãç¹ã«XMLãçµã¿ç«ã¦ã¦ããå ´åãªã©ã¯æ³¨æãå¿
è¦ã§ããifå¼å
¨ä½ãUnit
ã¨ãã¦è§£éããã¦ãã¾ãããããã®å¤æ´ç¹ãç¥ããªãã¨ãã¾ãã§æ¡ä»¶å¼ãfalse
ã«ãªã£ã¦ãã¾ã£ããã¨èª¤èªãã¦ãã¾ãã¾ãã
ã¾ã¨ã
2024å¹´5æç¾å¨ãåãµã¼ãã¹ã®Play/Scalaãã¼ã¸ã§ã³ã¯æ¬¡ã®ããã«ãªãã¾ããããµã¼ãã¹Bã¨ãµã¼ãã¹Cã¯ä¾åã©ã¤ãã©ãªã®é½åä¸ãPlay3.0ã«ä¸ãããã¨ã¯ã§ãã¾ããã§ããããPlay2.9ã«ã¾ã§ä¸ãããã¨ãã§ãã¾ãããä»å¾ãä¾åã©ã¤ãã©ãªããã¸ãã¯ãæ´çãããµã¼ãã¹Bã¨ãµã¼ãã¹CãPlay3.0ã«ä¸ããäºå®ã§ãã
ãµã¼ãã¹ | Play | Scala | åè |
---|---|---|---|
A | 3.0 | 3.3 | ãµã¼ãã¹Bã®RESTã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªã«ä¾å |
B | 2.9 | 2.13 | ãµã¼ãã¹AåãRESTã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªã®ã¿Scala3.3ã§ã¯ãã¹ãã«ã |
C | 2.9 | 2.13 |
Play3.0/Scala3.3ã¨ããçµã¿åããã¯ãã©ã¤ã»ã³ã¹ãé·æãµãã¼ãã¨ãã£ãé¢ã§æå©ãªã®ã§ãé·æéå®å®ãããµã¼ãã¹éç¨ãæä¾ãããå ´åã¯ãã¼ã¸ã§ã³ã¢ãããæ¤è¨ããæ¹ãè¯ãã§ãããããã®éã¯ä¾åã©ã¤ãã©ãªã«æ³¨æãã¦ãã¼ã¸ã§ã³ã¢ããã®è¨ç»ãç«ã¦ããã¨ãéè¦ã«ãªãã¾ãã
We are hiring !!
ã¨ã ã¹ãªã¼ã§ã¯ããµã¼ãã¹ã®å®å®éç¨ãéãã¦å»çæ¥çã«è²¢ç®ãã¦ãããã¨ã«èå³ããã仲éãåéãã¦ãã¾ãï¼
ã¾ãã¯ã«ã¸ã¥ã¢ã«é¢è«ããã以ä¸URLãããå¿åããå¾ ã¡ãã¦ãã¾ãã