SlideShare a Scribd company logo
Play-ing with Scala Futures
Backend guy at Cloud9rs Ltd.
(aka Senior Software Engineer)
tabdulradi@cloud9ers.com
twitter.com/tamer_radi
(few tweets, if any!)
About Scala
Martin Odersky
● He designed Java Generics
● Built the javac compiler
● In 2001, designed Scala
● In 2011, he founded
Typesafe Inc., a company
to support and promote
Scala
Who Uses Scala
More: http://www.scala-lang.org/node/1658
Why Scala
Can borrow from Java (runs on JVM)
Concise
Very OOP, Very Functional
Statically type, but with type inference.
Lazy values
class Rectangle(val w: Int, val l: Int)
class Square(s: Int) extends Rectangle(s, s)
Why Scala - Traits
Traits for cross-cutting modularity
Like Interfaces, but with implementation
class Man { def walk() {....} }
trait SuperPowers { def fly() {....} }
class SuperMan extends Man with SuperPowers
val superMan = new SuperMan
val superMan = new Man with SuperPowers
object SuperMan extends Man with SuperPowers {
def doLaserAndStuff() { ... } }
Why Scala - Concurrency
Parallel Collections
(1 to 10000).par.map(_ * 2).reduce(_ + _)
Note: reduce operation is not ordered
Futures
future { slowOperation() } foreach println
println("Hey, I don't have to wait")
Akka Actors (http://akka.io)
Play Framework
Stateless (easy to scale)
Built on Akka
Non-blocking I/O (uses JBoss Netty)
Real-time & Streaming are First Class Citizins
Websockets
EventSource
Comet
Production support by Typesafe
Many cloud deployment options
Now Let's Code..
The code is available on
https://github.com/tabdulradi/weather

More Related Content

Viewers also liked

What is Node.js used for: The 2015 Node.js Overview Report
What is Node.js used for: The 2015 Node.js Overview ReportWhat is Node.js used for: The 2015 Node.js Overview Report
What is Node.js used for: The 2015 Node.js Overview Report
Gabor Nagy
 
Key Components of an IoT Application Platform
Key Components of an IoT Application PlatformKey Components of an IoT Application Platform
Key Components of an IoT Application PlatformAnyPresence
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
leffen
 
Beacon bluetooth low energy
Beacon bluetooth low energyBeacon bluetooth low energy
Beacon bluetooth low energy
Arif Huda
 
Mobility and the Real-Time Enterprise
Mobility and the Real-Time EnterpriseMobility and the Real-Time Enterprise
Mobility and the Real-Time Enterprise
AnyPresence
 
Achieving Continuous Delivery: An Automation Story
Achieving Continuous Delivery: An Automation StoryAchieving Continuous Delivery: An Automation Story
Achieving Continuous Delivery: An Automation Story
jimi-c
 
Best Practices for API Adoption
Best Practices for API AdoptionBest Practices for API Adoption
Best Practices for API Adoption
AnyPresence
 
MongoDB and the MEAN Stack
MongoDB and the MEAN StackMongoDB and the MEAN Stack
MongoDB and the MEAN StackMongoDB
 
Introduction to Bluetooth Low Energy
Introduction to Bluetooth Low EnergyIntroduction to Bluetooth Low Energy
Introduction to Bluetooth Low Energy
yeokm1
 
Bluemix Paris Meetup : Big data et Analytics - 15 avril 2015
Bluemix Paris Meetup :  Big data et Analytics - 15 avril 2015Bluemix Paris Meetup :  Big data et Analytics - 15 avril 2015
Bluemix Paris Meetup : Big data et Analytics - 15 avril 2015IBM France Lab
 
Complete Update of All Exponential Technologies & Singularity cases and its I...
Complete Update of All Exponential Technologies & Singularity cases and its I...Complete Update of All Exponential Technologies & Singularity cases and its I...
Complete Update of All Exponential Technologies & Singularity cases and its I...
Yuri van Geest
 

Viewers also liked (12)

What is Node.js used for: The 2015 Node.js Overview Report
What is Node.js used for: The 2015 Node.js Overview ReportWhat is Node.js used for: The 2015 Node.js Overview Report
What is Node.js used for: The 2015 Node.js Overview Report
 
Key Components of an IoT Application Platform
Key Components of an IoT Application PlatformKey Components of an IoT Application Platform
Key Components of an IoT Application Platform
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 
Beacon bluetooth low energy
Beacon bluetooth low energyBeacon bluetooth low energy
Beacon bluetooth low energy
 
Iot presentation raharja
Iot presentation raharjaIot presentation raharja
Iot presentation raharja
 
Mobility and the Real-Time Enterprise
Mobility and the Real-Time EnterpriseMobility and the Real-Time Enterprise
Mobility and the Real-Time Enterprise
 
Achieving Continuous Delivery: An Automation Story
Achieving Continuous Delivery: An Automation StoryAchieving Continuous Delivery: An Automation Story
Achieving Continuous Delivery: An Automation Story
 
Best Practices for API Adoption
Best Practices for API AdoptionBest Practices for API Adoption
Best Practices for API Adoption
 
MongoDB and the MEAN Stack
MongoDB and the MEAN StackMongoDB and the MEAN Stack
MongoDB and the MEAN Stack
 
Introduction to Bluetooth Low Energy
Introduction to Bluetooth Low EnergyIntroduction to Bluetooth Low Energy
Introduction to Bluetooth Low Energy
 
Bluemix Paris Meetup : Big data et Analytics - 15 avril 2015
Bluemix Paris Meetup :  Big data et Analytics - 15 avril 2015Bluemix Paris Meetup :  Big data et Analytics - 15 avril 2015
Bluemix Paris Meetup : Big data et Analytics - 15 avril 2015
 
Complete Update of All Exponential Technologies & Singularity cases and its I...
Complete Update of All Exponential Technologies & Singularity cases and its I...Complete Update of All Exponential Technologies & Singularity cases and its I...
Complete Update of All Exponential Technologies & Singularity cases and its I...
 

Similar to Cw13 playing with scala by tamer abdelradi

Learn scala and it's componenents learn it
Learn scala and it's componenents learn itLearn scala and it's componenents learn it
Learn scala and it's componenents learn it
siddharth30121
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologist
pmanvi
 
Scala
ScalaScala
Scala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on HerokuScala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on HerokuHavoc Pennington
 
Scala overview
Scala overviewScala overview
Scala overviewSteve Min
 
Devoxx
DevoxxDevoxx
Stepping Up : A Brief Intro to Scala
Stepping Up : A Brief Intro to ScalaStepping Up : A Brief Intro to Scala
Stepping Up : A Brief Intro to Scala
Derek Chen-Becker
 
An Introduction to Scala
An Introduction to ScalaAn Introduction to Scala
An Introduction to ScalaBrent Lemons
 
The Scala Programming Language
The Scala Programming LanguageThe Scala Programming Language
The Scala Programming Language
Haim Michael
 
Scala in a nutshell
Scala in a nutshellScala in a nutshell
Scala in a nutshell
Kyel John M. David
 
Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for Scala
Marakana Inc.
 
Scala Introduction - Meetup Scaladores RJ
Scala Introduction - Meetup Scaladores RJScala Introduction - Meetup Scaladores RJ
Scala Introduction - Meetup Scaladores RJ
Rodrigo Lima
 
Scala the-good-parts
Scala the-good-partsScala the-good-parts
Scala the-good-parts
Fuqiang Wang
 
Scala for n00bs by a n00b.
Scala for n00bs by a n00b.Scala for n00bs by a n00b.
Scala for n00bs by a n00b.
brandongulla
 
Infographic on Scala Programming Language
Infographic on Scala Programming LanguageInfographic on Scala Programming Language
Infographic on Scala Programming Language
Paddy Lock
 
Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaWO Community
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
Martin Odersky
 
BCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersMiles Sabin
 
An Introduction to Scala for Java Developers
An Introduction to Scala for Java DevelopersAn Introduction to Scala for Java Developers
An Introduction to Scala for Java Developers
Miles Sabin
 

Similar to Cw13 playing with scala by tamer abdelradi (20)

Learn scala and it's componenents learn it
Learn scala and it's componenents learn itLearn scala and it's componenents learn it
Learn scala and it's componenents learn it
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologist
 
Scala
ScalaScala
Scala
 
Scala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on HerokuScala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on Heroku
 
Scala overview
Scala overviewScala overview
Scala overview
 
Devoxx
DevoxxDevoxx
Devoxx
 
Stepping Up : A Brief Intro to Scala
Stepping Up : A Brief Intro to ScalaStepping Up : A Brief Intro to Scala
Stepping Up : A Brief Intro to Scala
 
An Introduction to Scala
An Introduction to ScalaAn Introduction to Scala
An Introduction to Scala
 
The Scala Programming Language
The Scala Programming LanguageThe Scala Programming Language
The Scala Programming Language
 
Scala in a nutshell
Scala in a nutshellScala in a nutshell
Scala in a nutshell
 
Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for Scala
 
Scala Introduction - Meetup Scaladores RJ
Scala Introduction - Meetup Scaladores RJScala Introduction - Meetup Scaladores RJ
Scala Introduction - Meetup Scaladores RJ
 
Scala the-good-parts
Scala the-good-partsScala the-good-parts
Scala the-good-parts
 
Scala for n00bs by a n00b.
Scala for n00bs by a n00b.Scala for n00bs by a n00b.
Scala for n00bs by a n00b.
 
Infographic on Scala Programming Language
Infographic on Scala Programming LanguageInfographic on Scala Programming Language
Infographic on Scala Programming Language
 
Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with Scala
 
scala
scalascala
scala
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
 
BCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java Developers
 
An Introduction to Scala for Java Developers
An Introduction to Scala for Java DevelopersAn Introduction to Scala for Java Developers
An Introduction to Scala for Java Developers
 

More from TheInevitableCloud

Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...
Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...
Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...TheInevitableCloud
 
Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...
Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...
Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...TheInevitableCloud
 
Cw13 journy to the cloud by mohamed el mofty
Cw13 journy to the cloud by mohamed el moftyCw13 journy to the cloud by mohamed el mofty
Cw13 journy to the cloud by mohamed el moftyTheInevitableCloud
 
Cw13 securing your journey to the cloud by rami naccache-trend micro
Cw13 securing your journey to the cloud by rami naccache-trend microCw13 securing your journey to the cloud by rami naccache-trend micro
Cw13 securing your journey to the cloud by rami naccache-trend microTheInevitableCloud
 
Cw13 insights into the cloud market by abdelrahman wahid-cloud11
Cw13 insights into the cloud market by abdelrahman wahid-cloud11Cw13 insights into the cloud market by abdelrahman wahid-cloud11
Cw13 insights into the cloud market by abdelrahman wahid-cloud11TheInevitableCloud
 
Cw13 why cloud computing has to go the foss way by ahmed mekkawy
Cw13 why cloud computing has to go the foss way by ahmed mekkawyCw13 why cloud computing has to go the foss way by ahmed mekkawy
Cw13 why cloud computing has to go the foss way by ahmed mekkawyTheInevitableCloud
 
Cw13 fedora cloud by ahmed araby
Cw13 fedora cloud by ahmed arabyCw13 fedora cloud by ahmed araby
Cw13 fedora cloud by ahmed arabyTheInevitableCloud
 
Cw13 egypt twards open source by haitham nabil-open egypt
Cw13 egypt twards open source by haitham nabil-open egyptCw13 egypt twards open source by haitham nabil-open egypt
Cw13 egypt twards open source by haitham nabil-open egyptTheInevitableCloud
 
Cw13 dell cloud computing for telco sp by anis tell
Cw13 dell cloud computing for telco sp by anis tellCw13 dell cloud computing for telco sp by anis tell
Cw13 dell cloud computing for telco sp by anis tellTheInevitableCloud
 
Cw13 culture of innovation by mohamed el mofty
Cw13 culture of innovation by mohamed el moftyCw13 culture of innovation by mohamed el mofty
Cw13 culture of innovation by mohamed el moftyTheInevitableCloud
 
Cw13 build open hybrid cloud by diaa radwan-red hat
Cw13 build open hybrid cloud by diaa radwan-red hatCw13 build open hybrid cloud by diaa radwan-red hat
Cw13 build open hybrid cloud by diaa radwan-red hatTheInevitableCloud
 
Cw13 aws by tamer abdul radi-cloud9ners
Cw13 aws by tamer abdul radi-cloud9nersCw13 aws by tamer abdul radi-cloud9ners
Cw13 aws by tamer abdul radi-cloud9nersTheInevitableCloud
 
Intro to Big Data and Apache Hadoop by Dr. Amr Awadallah at CLOUD WEEKEND '13...
Intro to Big Data and Apache Hadoop by Dr. Amr Awadallah at CLOUD WEEKEND '13...Intro to Big Data and Apache Hadoop by Dr. Amr Awadallah at CLOUD WEEKEND '13...
Intro to Big Data and Apache Hadoop by Dr. Amr Awadallah at CLOUD WEEKEND '13...
TheInevitableCloud
 

More from TheInevitableCloud (13)

Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...
Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...
Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...
 
Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...
Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...
Cw13 the rising stack-how & why open stack is changing it by mark collier-ope...
 
Cw13 journy to the cloud by mohamed el mofty
Cw13 journy to the cloud by mohamed el moftyCw13 journy to the cloud by mohamed el mofty
Cw13 journy to the cloud by mohamed el mofty
 
Cw13 securing your journey to the cloud by rami naccache-trend micro
Cw13 securing your journey to the cloud by rami naccache-trend microCw13 securing your journey to the cloud by rami naccache-trend micro
Cw13 securing your journey to the cloud by rami naccache-trend micro
 
Cw13 insights into the cloud market by abdelrahman wahid-cloud11
Cw13 insights into the cloud market by abdelrahman wahid-cloud11Cw13 insights into the cloud market by abdelrahman wahid-cloud11
Cw13 insights into the cloud market by abdelrahman wahid-cloud11
 
Cw13 why cloud computing has to go the foss way by ahmed mekkawy
Cw13 why cloud computing has to go the foss way by ahmed mekkawyCw13 why cloud computing has to go the foss way by ahmed mekkawy
Cw13 why cloud computing has to go the foss way by ahmed mekkawy
 
Cw13 fedora cloud by ahmed araby
Cw13 fedora cloud by ahmed arabyCw13 fedora cloud by ahmed araby
Cw13 fedora cloud by ahmed araby
 
Cw13 egypt twards open source by haitham nabil-open egypt
Cw13 egypt twards open source by haitham nabil-open egyptCw13 egypt twards open source by haitham nabil-open egypt
Cw13 egypt twards open source by haitham nabil-open egypt
 
Cw13 dell cloud computing for telco sp by anis tell
Cw13 dell cloud computing for telco sp by anis tellCw13 dell cloud computing for telco sp by anis tell
Cw13 dell cloud computing for telco sp by anis tell
 
Cw13 culture of innovation by mohamed el mofty
Cw13 culture of innovation by mohamed el moftyCw13 culture of innovation by mohamed el mofty
Cw13 culture of innovation by mohamed el mofty
 
Cw13 build open hybrid cloud by diaa radwan-red hat
Cw13 build open hybrid cloud by diaa radwan-red hatCw13 build open hybrid cloud by diaa radwan-red hat
Cw13 build open hybrid cloud by diaa radwan-red hat
 
Cw13 aws by tamer abdul radi-cloud9ners
Cw13 aws by tamer abdul radi-cloud9nersCw13 aws by tamer abdul radi-cloud9ners
Cw13 aws by tamer abdul radi-cloud9ners
 
Intro to Big Data and Apache Hadoop by Dr. Amr Awadallah at CLOUD WEEKEND '13...
Intro to Big Data and Apache Hadoop by Dr. Amr Awadallah at CLOUD WEEKEND '13...Intro to Big Data and Apache Hadoop by Dr. Amr Awadallah at CLOUD WEEKEND '13...
Intro to Big Data and Apache Hadoop by Dr. Amr Awadallah at CLOUD WEEKEND '13...
 

Cw13 playing with scala by tamer abdelradi

  • 1. Play-ing with Scala Futures Backend guy at Cloud9rs Ltd. (aka Senior Software Engineer) tabdulradi@cloud9ers.com twitter.com/tamer_radi (few tweets, if any!)
  • 2. About Scala Martin Odersky ● He designed Java Generics ● Built the javac compiler ● In 2001, designed Scala ● In 2011, he founded Typesafe Inc., a company to support and promote Scala
  • 3. Who Uses Scala More: http://www.scala-lang.org/node/1658
  • 4. Why Scala Can borrow from Java (runs on JVM) Concise Very OOP, Very Functional Statically type, but with type inference. Lazy values class Rectangle(val w: Int, val l: Int) class Square(s: Int) extends Rectangle(s, s)
  • 5. Why Scala - Traits Traits for cross-cutting modularity Like Interfaces, but with implementation class Man { def walk() {....} } trait SuperPowers { def fly() {....} } class SuperMan extends Man with SuperPowers val superMan = new SuperMan val superMan = new Man with SuperPowers object SuperMan extends Man with SuperPowers { def doLaserAndStuff() { ... } }
  • 6. Why Scala - Concurrency Parallel Collections (1 to 10000).par.map(_ * 2).reduce(_ + _) Note: reduce operation is not ordered Futures future { slowOperation() } foreach println println("Hey, I don't have to wait") Akka Actors (http://akka.io)
  • 7. Play Framework Stateless (easy to scale) Built on Akka Non-blocking I/O (uses JBoss Netty) Real-time & Streaming are First Class Citizins Websockets EventSource Comet Production support by Typesafe Many cloud deployment options
  • 8. Now Let's Code.. The code is available on https://github.com/tabdulradi/weather