Your SlideShare is downloading. ×

Playing with Scala

487

Published on

A fast intro to Scala and Play, to prepare the audience for a live demo of a Play Application using Futures to get weather data from Yahoo in a non blocking way, then display to the user the …

A fast intro to Scala and Play, to prepare the audience for a live demo of a Play Application using Futures to get weather data from Yahoo in a non blocking way, then display to the user the results.
The code is available here https://github.com/tabdulradi/weather

Published in: Technology, Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
487
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
8
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-ing with Scala FuturesBackend guy at Cloud9rs Ltd.(aka Senior Software Engineer)tabdulradi@cloud9ers.comtwitter.com/tamer_radi(few tweets, if any!)
  • 2. About ScalaMartin Odersky● He designed Java Generics● Built the javac compiler● In 2001, designed Scala● In 2011, he foundedTypesafe Inc., a companyto support and promoteScala
  • 3. Who Uses ScalaMore: http://www.scala-lang.org/node/1658
  • 4. Why ScalaCan borrow from Java (runs on JVM)ConciseVery OOP, Very FunctionalStatically type, but with type inference.Lazy valuesclass Rectangle(val w: Int, val l: Int)class Square(s: Int) extends Rectangle(s, s)
  • 5. Why Scala - TraitsTraits for cross-cutting modularityLike Interfaces, but with implementationclass Man { def walk() {....} }trait SuperPowers { def fly() {....} }class SuperMan extends Man with SuperPowersval superMan = new SuperManval superMan = new Man with SuperPowersobject SuperMan extends Man with SuperPowers {def doLaserAndStuff() { ... } }
  • 6. Why Scala - ConcurrencyParallel Collections(1 to 10000).par.map(_ * 2).reduce(_ + _)Note: reduce operation is not orderedFuturesfuture { slowOperation() } foreach printlnprintln("Hey, I dont have to wait")Akka Actors (http://akka.io)
  • 7. Play FrameworkStateless (easy to scale)Built on AkkaNon-blocking I/O (uses JBoss Netty)Real-time & Streaming are First Class CitizinsWebsocketsEventSourceCometProduction support by TypesafeMany cloud deployment options
  • 8. Now Lets Code..The code is available onhttps://github.com/tabdulradi/weather

×