Cw13 playing with scala by tamer abdelradi
Upcoming SlideShare
Loading in...5
×
 

Cw13 playing with scala by tamer abdelradi

on

  • 124 views

 

Statistics

Views

Total Views
124
Views on SlideShare
124
Embed Views
0

Actions

Likes
0
Downloads
0
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

Cw13 playing with scala by tamer abdelradi Cw13 playing with scala by tamer abdelradi Presentation Transcript

  • Play-ing with Scala FuturesBackend guy at Cloud9rs Ltd.(aka Senior Software Engineer)tabdulradi@cloud9ers.comtwitter.com/tamer_radi(few tweets, if any!)
  • 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
  • Who Uses ScalaMore: http://www.scala-lang.org/node/1658
  • 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)
  • 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() { ... } }
  • 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)
  • 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
  • Now Lets Code..The code is available onhttps://github.com/tabdulradi/weather