SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
Mario Fusco
2010
X6
The feel of Scala
Agilité iPhone Java Incubateur
8:15 Accueil des participantsAccueil des participantsAccueil des participantsAccueil des participants
8:40 Mot des organisateurs & Criée des orateursMot des organisateurs & Criée des orateursMot des organisateurs & Criée des orateursMot des organisateurs & Criée des orateurs
9:00 Keynote de Nicolas Martignole (30 minutes)Keynote de Nicolas Martignole (30 minutes)Keynote de Nicolas Martignole (30 minutes)Keynote de Nicolas Martignole (30 minutes)
9:40
10:40
- A1 -
Le terrain Agile
Jean-Philippe Vigniel
- I1-
Hello iPhone
Stephane Tavera
- J1 -
NOSQL also means RDF stores: an
Android case study
Fabrizio Giudci
- X1 -
Le développement durable
Dominic Williams
11:00
12:00
- A2 -
Integration of User Centered Design
in Agile Development of RIA
J. Borkenhagen, J. Desmazières
- I2 -
Développement d'une application
iPhone pilotée par les tests
Emmanuel Etasse, Van-Charles Tran
- J2 -
La Tequila du développement Web
Nicolas Martignole
- X2 -
Cloud Computing: anatomie et
pratique
Marc-Elian Bégin
12:20
13:20
- A3 -
Adoption de l'Agilité par les usages
Xavier Warzee
- I3 -
Distribution d'applications iPhone
en Entreprise: Réalisation d'un
AppStore interne
Géraud de Laval
- J3 -
Vaadin - Rich Web Applications in
Server-side Java without Plug-ins or
JavaScript
Joonas Lehtinen
- X3 -
Les DVCS sont vos amis
Sébastien Douche
Pause repas (50 minutes)Pause repas (50 minutes)Pause repas (50 minutes)Pause repas (50 minutes)
14h10 Keynote de Regis Medina (30 minutes)Keynote de Regis Medina (30 minutes)Keynote de Regis Medina (30 minutes)Keynote de Regis Medina (30 minutes)
14h50
15h50
- A4 -
Scrum, introduction et mise en
oeuvre avec iceScrum
Claude Aubry
- I4 -
Agile iOS Development
Jérôme Layat, Alexander Osterwalder
- J4 -
JAX-RS and Java EE 6
Paul Sandoz
- X4 -
IT Design & Ergonomy
Pascal Petit, Aude Lussigny
16h10
17h10
- A5 -
Agilité : 10 ans déjà
Thierry Cros
- I5 -
Optimizing iOS applications
Marc-Antoine Scheurer
- J5 -
Ecrivez et automatisez vos tests
fonctionnels avec jBehave
Xavier Bourguignon
- X5 -
NoSQL : Enfin de la biodiversité
dans l'écosystème des BD
Olivier Mallassi
17h30
18h30
- A6 -
Lean engineering
Jean-Christophe Dubail
- I6 -
iPhone et Agile, l'amour vache
Guillaume Duquesnay
- J6 -
Let's make this test suite run faster
David Gageot
- X6 -
The feel of Scala
Mario Fusco
Mot de la fin & tombolaMot de la fin & tombolaMot de la fin & tombolaMot de la fin & tombola
Programme de la Conférence
www.soft-shake.ch
The Feel of
Mario Fusco
mario.fusco@gmail.com
Twitter: @mariofusco
by
Mario Fusco
mario.fusco@gmail.com
Twitter: @mariofusco
lambdaj.googlecode.com
Do we need a new language?
Keep It Simple
Vs.
Do More With Less
Why Scala?
object-oriented
functional
Java compatible
concise
extensible
statically typed
concurrent
scriptable
Functions and Closures
val isPositive = (x: Int) => x > 0
val numbers = List(-10, 5, 3, -2, 0, 1)
val positiveNumber = numbers.filter(isPostive)
val positiveNumber = numbers.filter(x => x > 0)
val positiveNumber = numbers.filter(_ > 0)
Scala Collections
val animals = List(“dog”, “cat”, “horse”, “rabbit”)
val romanNumbers = Map(1 -> “I”, 2 -> “II”, 3 -> “III”)
animals.foreach(s => println(s))
animals.foreach(println _)
animals.foreach(println)
animals.map(s => s + “s”)
animals.mkString(“, “)
animals.count(s => s.length > 3)
animals.remove(s => s.length > 3)
animals.sort((s,t) => s.charAt(1) < t.charAt(1))
Tuples
val pair = (2, “items”)
println(pair._1) // prints 2
println(pair._2) // prints items
Clear distinction between
mutable and immutable data
val msg = “Hello,world!” // constant
var value = 3 // variable
scala.collection
scala.collection.immutable scala.collection.mutable
Named and default parameters
class Person(name: String = "Goofy", age: Int = 30,
location: String = "Milano")
Person(name = "Mario", age = 36, location = "Lugano")
Person(age = 36, location = "Lugano", name = "Mario")
Person(age = 36, name = "Mario")
Person(age = 36)
Person()
Operator overloading
class Rational (n: Int, d: Int) {
def this(n: Int) = this(n, 1)
def + (that: Rational): Rational =
new Rational(n * that.d + that.n * d, d * that.d)
def + (i: Int): Rational = new Rational(n + i * d, d)
}
Implicit conversion
val a = new Rational(2, 3)
val b = a + 2 // = 8/3
val c = 2 + a // Compilation Error
implicit def intToRational(x: Int) = new Rational(x)
Val c = 2 + a // = 8/3
Options
Tony Hoare, who invented the null reference in 1965 while
working on an object oriented language called ALGOL W, called
its invention his “billion dollar mistake”
val capitals = Map("Italy" -> "Rome", "Switzerland" -> "Bern",
"Germany" -> "Berlin" , "France" -> "Paris")
println(capitals.get("Italy")) // Some(Rome)
println(capitals.get("Spain")) // None
println(capitals.get("Italy").get) // Rome
println(capitals.get("Spain").get) // thorws Exception
println(capitals.get("Spain").getOrElse("Unknown")) // Unknown
Traits
class Animal { def eat(): Unit }
trait Mammal extends Animal { def giveBirth(): Mammal }
trait HasWings extends Animal { def fly(): Unit }
trait HasLegs extends Animal { def walk(): Unit }
class Snake extends Animal
class Frog extends Animal with HasLegs
class Cat extends Animal with Mammal with HasLegs
class Bat extends Animal with Mammal with HasWings
class Chimera extends Animal with Mammal with HasWings with HasLegs
Case classes
trait Expr
case class Var(name: String) extends Expr
case class Number(num: Double) extends Expr
case class Unop(op: String, arg: Expr) extends Expr
case class Binop(op: String, l: Expr, r: Expr) extends Expr
Pattern matching
def simplify(expr: Expr): Expr = expr match {
case Unop("-", Unop("-", e)) => e // Double negation
case Binop("+", e, Number(0)) => e // Adding zero
case Binop("*", e, Number(1)) => e // Multiplying by one
case _ => expr
}
// Simplify double negation: simplified = Var("x")
val simplified = simplify(Unop("-", Unop("-", Var("x"))))
Structural Typing
(duck typing done right)
class Duck {
quack() { println "quack" }
}
doQuack(new Duck)
doQuack(d) { d.quack() }
class Dog {
barf() { println "barf" }
}
doQuack(new Dog)
def doQuack(d:{ def quack():Unit }) =
d.quack()
class Duck {
def quack() = println "quack"
}
doQuack(new Duck)
class Dog {
def barf() = println "barf"
}
doQuack(new Dog)runtime error
compilation
error
Duck typing is the dynamic mechanism that allows to discover a dog cannot
say quack only at runtime... in production ... on friday evening
Actors
val printerActor = actor {
loop {
receive {
case s: String => println("I got a String: " + s)
case i: Int => println("I got an Int: " + i.toString)
case _ => println(" I don’t know what I got ")
}
}
}
printerActor ! "hi there“ // prints “I got a String: hi there”
printerActor ! 23 // prints “I got an Int: 23”
printerActor ! 3.33 // prints “I don’t know what I got”
The ecosystem
Who is using Scala ?
Norbert by LinkedIn
• Norbert is a framework written in Scala that
allows to write asynchronous, message based,
client/server applications
• Built on Apache ZooKeeper and JBoss Netty,
Norbert to make it easy to build a cluster aware
application
• Provides out of the box support for notifications
of cluster topology changes, application specific
routing, load balancing and partitioned workload
• Akka is a framework that allows to write simpler
concurrent (yet correct) applications
• It provides a higher level of abstraction for
writing concurrent and distributed systems
through (remote) actors
• It implements Software Transactional Memory
(STM) turning the Java heap into a transactional
data set with begin/commit/rollback semantic
• Fault-tolerant adopting the "Let it crash" /
"Embrace failure" model
SBT (simple-build-tool)
• Sbt is a build tool written in Scala
• Uses the same directory structure as
Maven for source files
• Uses Ivy to resolve dependencies
• Compatible with Maven configuration files
• Supports testing with ScalaTest
• Parallel task execution, including parallel
test execution
Happy Scala programming!
Thanks a lot
Mario Fusco
mario.fusco@gmail.com
Twitter: @mariofusco

Más contenido relacionado

Similar a soft-shake.ch - The feel of Scala

xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)xlwings
 
A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9Marcus Lagergren
 
Getting Started with iBeacons (Designers of Things 2014)
Getting Started with iBeacons (Designers of Things 2014)Getting Started with iBeacons (Designers of Things 2014)
Getting Started with iBeacons (Designers of Things 2014)Daniel Luxemburg
 
Being Expressive in Code
Being Expressive in CodeBeing Expressive in Code
Being Expressive in CodeEamonn Boyle
 
He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!François-Guillaume Ribreau
 
Real-World Functional Programming @ Incubaid
Real-World Functional Programming @ IncubaidReal-World Functional Programming @ Incubaid
Real-World Functional Programming @ IncubaidNicolas Trangez
 
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Christian Schneider
 
Building a Cutting-Edge Data Process Environment on a Budget by Gael Varoquaux
Building a Cutting-Edge Data Process Environment on a Budget by Gael VaroquauxBuilding a Cutting-Edge Data Process Environment on a Budget by Gael Varoquaux
Building a Cutting-Edge Data Process Environment on a Budget by Gael VaroquauxPyData
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsSerge Stinckwich
 
Eric Lafortune - The Jack and Jill build system
Eric Lafortune - The Jack and Jill build systemEric Lafortune - The Jack and Jill build system
Eric Lafortune - The Jack and Jill build systemGuardSquare
 
PySpark with Juypter
PySpark with JuypterPySpark with Juypter
PySpark with JuypterLi Ming Tsai
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisC4Media
 
Entering the Fourth Dimension of OCR with Tesseract
Entering the Fourth Dimension of OCR with TesseractEntering the Fourth Dimension of OCR with Tesseract
Entering the Fourth Dimension of OCR with Tesseract🎤 Hanno Embregts 🎸
 
The things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaThe things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaKonrad Malawski
 
Controlando o windows like a boss com o Intel RealSense SDK
Controlando o windows like a boss com o Intel RealSense SDKControlando o windows like a boss com o Intel RealSense SDK
Controlando o windows like a boss com o Intel RealSense SDKAndre Carlucci
 
NYU Hacknight: iOS and OSX ABI
NYU Hacknight: iOS and OSX ABINYU Hacknight: iOS and OSX ABI
NYU Hacknight: iOS and OSX ABIMikhail Sosonkin
 
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Codemotion
 
Python for System Administrators
Python for System AdministratorsPython for System Administrators
Python for System AdministratorsRoberto Polli
 

Similar a soft-shake.ch - The feel of Scala (20)

xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)
 
A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9
 
Getting Started with iBeacons (Designers of Things 2014)
Getting Started with iBeacons (Designers of Things 2014)Getting Started with iBeacons (Designers of Things 2014)
Getting Started with iBeacons (Designers of Things 2014)
 
MacRuby, an introduction
MacRuby, an introductionMacRuby, an introduction
MacRuby, an introduction
 
Being Expressive in Code
Being Expressive in CodeBeing Expressive in Code
Being Expressive in Code
 
He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!
 
Real-World Functional Programming @ Incubaid
Real-World Functional Programming @ IncubaidReal-World Functional Programming @ Incubaid
Real-World Functional Programming @ Incubaid
 
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
 
Building a Cutting-Edge Data Process Environment on a Budget by Gael Varoquaux
Building a Cutting-Edge Data Process Environment on a Budget by Gael VaroquauxBuilding a Cutting-Edge Data Process Environment on a Budget by Gael Varoquaux
Building a Cutting-Edge Data Process Environment on a Budget by Gael Varoquaux
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systems
 
Eric Lafortune - The Jack and Jill build system
Eric Lafortune - The Jack and Jill build systemEric Lafortune - The Jack and Jill build system
Eric Lafortune - The Jack and Jill build system
 
PySpark with Juypter
PySpark with JuypterPySpark with Juypter
PySpark with Juypter
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
 
Why Kotlin is your next language?
Why Kotlin is your next language? Why Kotlin is your next language?
Why Kotlin is your next language?
 
Entering the Fourth Dimension of OCR with Tesseract
Entering the Fourth Dimension of OCR with TesseractEntering the Fourth Dimension of OCR with Tesseract
Entering the Fourth Dimension of OCR with Tesseract
 
The things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaThe things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and Akka
 
Controlando o windows like a boss com o Intel RealSense SDK
Controlando o windows like a boss com o Intel RealSense SDKControlando o windows like a boss com o Intel RealSense SDK
Controlando o windows like a boss com o Intel RealSense SDK
 
NYU Hacknight: iOS and OSX ABI
NYU Hacknight: iOS and OSX ABINYU Hacknight: iOS and OSX ABI
NYU Hacknight: iOS and OSX ABI
 
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
 
Python for System Administrators
Python for System AdministratorsPython for System Administrators
Python for System Administrators
 

Más de soft-shake.ch

soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?
soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?
soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?soft-shake.ch
 
soft-shake.ch - Introduction to HTML5
soft-shake.ch - Introduction to HTML5soft-shake.ch - Introduction to HTML5
soft-shake.ch - Introduction to HTML5soft-shake.ch
 
soft-shake.ch - WebMatrix: Your Web Made Easy
soft-shake.ch - WebMatrix: Your Web Made Easysoft-shake.ch - WebMatrix: Your Web Made Easy
soft-shake.ch - WebMatrix: Your Web Made Easysoft-shake.ch
 
soft-shake.ch - Domotique et robotique avec le micro Framework .NET
soft-shake.ch - Domotique et robotique avec le micro Framework .NETsoft-shake.ch - Domotique et robotique avec le micro Framework .NET
soft-shake.ch - Domotique et robotique avec le micro Framework .NETsoft-shake.ch
 
soft-shake.ch - Clojure Values
soft-shake.ch - Clojure Valuessoft-shake.ch - Clojure Values
soft-shake.ch - Clojure Valuessoft-shake.ch
 
soft-shake.ch - Data grids and Data Grids
soft-shake.ch - Data grids and Data Gridssoft-shake.ch - Data grids and Data Grids
soft-shake.ch - Data grids and Data Gridssoft-shake.ch
 
soft-shake.ch - Data grids and Data Caching
soft-shake.ch - Data grids and Data Cachingsoft-shake.ch - Data grids and Data Caching
soft-shake.ch - Data grids and Data Cachingsoft-shake.ch
 
soft-shake.ch - JBoss AS 7, la révolution
soft-shake.ch - JBoss AS 7, la révolutionsoft-shake.ch - JBoss AS 7, la révolution
soft-shake.ch - JBoss AS 7, la révolutionsoft-shake.ch
 
soft-shake.ch - Java SE 7: The Fork/Join Framework and Project Coin
soft-shake.ch - Java SE 7: The Fork/Join Framework and Project Coinsoft-shake.ch - Java SE 7: The Fork/Join Framework and Project Coin
soft-shake.ch - Java SE 7: The Fork/Join Framework and Project Coinsoft-shake.ch
 
soft-shake.ch - Tests d'intégration JavaEE avec Arquillian
soft-shake.ch - Tests d'intégration JavaEE avec Arquilliansoft-shake.ch - Tests d'intégration JavaEE avec Arquillian
soft-shake.ch - Tests d'intégration JavaEE avec Arquilliansoft-shake.ch
 
soft-shake.ch - Un zeste d’Erlang dans le shaker!
soft-shake.ch - Un zeste d’Erlang dans le shaker!soft-shake.ch - Un zeste d’Erlang dans le shaker!
soft-shake.ch - Un zeste d’Erlang dans le shaker!soft-shake.ch
 
soft-shake.ch - Déploiement continu sur le cloud avec SlipStream
soft-shake.ch - Déploiement continu sur le cloud avec SlipStreamsoft-shake.ch - Déploiement continu sur le cloud avec SlipStream
soft-shake.ch - Déploiement continu sur le cloud avec SlipStreamsoft-shake.ch
 
soft-shake.ch - An introduction to social architecture
soft-shake.ch - An introduction to social architecturesoft-shake.ch - An introduction to social architecture
soft-shake.ch - An introduction to social architecturesoft-shake.ch
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch
 
soft-shake.ch - De Hermes RUP à Hermes Scrum
soft-shake.ch - De Hermes RUP à Hermes Scrumsoft-shake.ch - De Hermes RUP à Hermes Scrum
soft-shake.ch - De Hermes RUP à Hermes Scrumsoft-shake.ch
 
soft-shake.ch - Stewardship et motivation
soft-shake.ch - Stewardship et motivationsoft-shake.ch - Stewardship et motivation
soft-shake.ch - Stewardship et motivationsoft-shake.ch
 
soft-shake.ch - Agile qu'es aco : scrum xp lean
soft-shake.ch - Agile qu'es aco : scrum xp leansoft-shake.ch - Agile qu'es aco : scrum xp lean
soft-shake.ch - Agile qu'es aco : scrum xp leansoft-shake.ch
 
soft-shake.ch - Documentation et agilité
soft-shake.ch - Documentation et agilitésoft-shake.ch - Documentation et agilité
soft-shake.ch - Documentation et agilitésoft-shake.ch
 
soft-shake.ch - Agilité = discipline et rigueur ?
soft-shake.ch - Agilité = discipline et rigueur ?soft-shake.ch - Agilité = discipline et rigueur ?
soft-shake.ch - Agilité = discipline et rigueur ?soft-shake.ch
 
soft-shake.ch - Transition agile & Accompagnement au changement
soft-shake.ch - Transition agile & Accompagnement au changementsoft-shake.ch - Transition agile & Accompagnement au changement
soft-shake.ch - Transition agile & Accompagnement au changementsoft-shake.ch
 

Más de soft-shake.ch (20)

soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?
soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?
soft-shake.ch - Windows Phone 7 „Mango“ – what’s new for Developers?
 
soft-shake.ch - Introduction to HTML5
soft-shake.ch - Introduction to HTML5soft-shake.ch - Introduction to HTML5
soft-shake.ch - Introduction to HTML5
 
soft-shake.ch - WebMatrix: Your Web Made Easy
soft-shake.ch - WebMatrix: Your Web Made Easysoft-shake.ch - WebMatrix: Your Web Made Easy
soft-shake.ch - WebMatrix: Your Web Made Easy
 
soft-shake.ch - Domotique et robotique avec le micro Framework .NET
soft-shake.ch - Domotique et robotique avec le micro Framework .NETsoft-shake.ch - Domotique et robotique avec le micro Framework .NET
soft-shake.ch - Domotique et robotique avec le micro Framework .NET
 
soft-shake.ch - Clojure Values
soft-shake.ch - Clojure Valuessoft-shake.ch - Clojure Values
soft-shake.ch - Clojure Values
 
soft-shake.ch - Data grids and Data Grids
soft-shake.ch - Data grids and Data Gridssoft-shake.ch - Data grids and Data Grids
soft-shake.ch - Data grids and Data Grids
 
soft-shake.ch - Data grids and Data Caching
soft-shake.ch - Data grids and Data Cachingsoft-shake.ch - Data grids and Data Caching
soft-shake.ch - Data grids and Data Caching
 
soft-shake.ch - JBoss AS 7, la révolution
soft-shake.ch - JBoss AS 7, la révolutionsoft-shake.ch - JBoss AS 7, la révolution
soft-shake.ch - JBoss AS 7, la révolution
 
soft-shake.ch - Java SE 7: The Fork/Join Framework and Project Coin
soft-shake.ch - Java SE 7: The Fork/Join Framework and Project Coinsoft-shake.ch - Java SE 7: The Fork/Join Framework and Project Coin
soft-shake.ch - Java SE 7: The Fork/Join Framework and Project Coin
 
soft-shake.ch - Tests d'intégration JavaEE avec Arquillian
soft-shake.ch - Tests d'intégration JavaEE avec Arquilliansoft-shake.ch - Tests d'intégration JavaEE avec Arquillian
soft-shake.ch - Tests d'intégration JavaEE avec Arquillian
 
soft-shake.ch - Un zeste d’Erlang dans le shaker!
soft-shake.ch - Un zeste d’Erlang dans le shaker!soft-shake.ch - Un zeste d’Erlang dans le shaker!
soft-shake.ch - Un zeste d’Erlang dans le shaker!
 
soft-shake.ch - Déploiement continu sur le cloud avec SlipStream
soft-shake.ch - Déploiement continu sur le cloud avec SlipStreamsoft-shake.ch - Déploiement continu sur le cloud avec SlipStream
soft-shake.ch - Déploiement continu sur le cloud avec SlipStream
 
soft-shake.ch - An introduction to social architecture
soft-shake.ch - An introduction to social architecturesoft-shake.ch - An introduction to social architecture
soft-shake.ch - An introduction to social architecture
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
soft-shake.ch - De Hermes RUP à Hermes Scrum
soft-shake.ch - De Hermes RUP à Hermes Scrumsoft-shake.ch - De Hermes RUP à Hermes Scrum
soft-shake.ch - De Hermes RUP à Hermes Scrum
 
soft-shake.ch - Stewardship et motivation
soft-shake.ch - Stewardship et motivationsoft-shake.ch - Stewardship et motivation
soft-shake.ch - Stewardship et motivation
 
soft-shake.ch - Agile qu'es aco : scrum xp lean
soft-shake.ch - Agile qu'es aco : scrum xp leansoft-shake.ch - Agile qu'es aco : scrum xp lean
soft-shake.ch - Agile qu'es aco : scrum xp lean
 
soft-shake.ch - Documentation et agilité
soft-shake.ch - Documentation et agilitésoft-shake.ch - Documentation et agilité
soft-shake.ch - Documentation et agilité
 
soft-shake.ch - Agilité = discipline et rigueur ?
soft-shake.ch - Agilité = discipline et rigueur ?soft-shake.ch - Agilité = discipline et rigueur ?
soft-shake.ch - Agilité = discipline et rigueur ?
 
soft-shake.ch - Transition agile & Accompagnement au changement
soft-shake.ch - Transition agile & Accompagnement au changementsoft-shake.ch - Transition agile & Accompagnement au changement
soft-shake.ch - Transition agile & Accompagnement au changement
 

Último

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Último (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

soft-shake.ch - The feel of Scala

  • 2. Agilité iPhone Java Incubateur 8:15 Accueil des participantsAccueil des participantsAccueil des participantsAccueil des participants 8:40 Mot des organisateurs & Criée des orateursMot des organisateurs & Criée des orateursMot des organisateurs & Criée des orateursMot des organisateurs & Criée des orateurs 9:00 Keynote de Nicolas Martignole (30 minutes)Keynote de Nicolas Martignole (30 minutes)Keynote de Nicolas Martignole (30 minutes)Keynote de Nicolas Martignole (30 minutes) 9:40 10:40 - A1 - Le terrain Agile Jean-Philippe Vigniel - I1- Hello iPhone Stephane Tavera - J1 - NOSQL also means RDF stores: an Android case study Fabrizio Giudci - X1 - Le développement durable Dominic Williams 11:00 12:00 - A2 - Integration of User Centered Design in Agile Development of RIA J. Borkenhagen, J. Desmazières - I2 - Développement d'une application iPhone pilotée par les tests Emmanuel Etasse, Van-Charles Tran - J2 - La Tequila du développement Web Nicolas Martignole - X2 - Cloud Computing: anatomie et pratique Marc-Elian Bégin 12:20 13:20 - A3 - Adoption de l'Agilité par les usages Xavier Warzee - I3 - Distribution d'applications iPhone en Entreprise: Réalisation d'un AppStore interne Géraud de Laval - J3 - Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaScript Joonas Lehtinen - X3 - Les DVCS sont vos amis Sébastien Douche Pause repas (50 minutes)Pause repas (50 minutes)Pause repas (50 minutes)Pause repas (50 minutes) 14h10 Keynote de Regis Medina (30 minutes)Keynote de Regis Medina (30 minutes)Keynote de Regis Medina (30 minutes)Keynote de Regis Medina (30 minutes) 14h50 15h50 - A4 - Scrum, introduction et mise en oeuvre avec iceScrum Claude Aubry - I4 - Agile iOS Development Jérôme Layat, Alexander Osterwalder - J4 - JAX-RS and Java EE 6 Paul Sandoz - X4 - IT Design & Ergonomy Pascal Petit, Aude Lussigny 16h10 17h10 - A5 - Agilité : 10 ans déjà Thierry Cros - I5 - Optimizing iOS applications Marc-Antoine Scheurer - J5 - Ecrivez et automatisez vos tests fonctionnels avec jBehave Xavier Bourguignon - X5 - NoSQL : Enfin de la biodiversité dans l'écosystème des BD Olivier Mallassi 17h30 18h30 - A6 - Lean engineering Jean-Christophe Dubail - I6 - iPhone et Agile, l'amour vache Guillaume Duquesnay - J6 - Let's make this test suite run faster David Gageot - X6 - The feel of Scala Mario Fusco Mot de la fin & tombolaMot de la fin & tombolaMot de la fin & tombolaMot de la fin & tombola Programme de la Conférence www.soft-shake.ch
  • 3. The Feel of Mario Fusco mario.fusco@gmail.com Twitter: @mariofusco by
  • 5. Do we need a new language? Keep It Simple Vs. Do More With Less
  • 7. Functions and Closures val isPositive = (x: Int) => x > 0 val numbers = List(-10, 5, 3, -2, 0, 1) val positiveNumber = numbers.filter(isPostive) val positiveNumber = numbers.filter(x => x > 0) val positiveNumber = numbers.filter(_ > 0)
  • 8. Scala Collections val animals = List(“dog”, “cat”, “horse”, “rabbit”) val romanNumbers = Map(1 -> “I”, 2 -> “II”, 3 -> “III”) animals.foreach(s => println(s)) animals.foreach(println _) animals.foreach(println) animals.map(s => s + “s”) animals.mkString(“, “) animals.count(s => s.length > 3) animals.remove(s => s.length > 3) animals.sort((s,t) => s.charAt(1) < t.charAt(1))
  • 9. Tuples val pair = (2, “items”) println(pair._1) // prints 2 println(pair._2) // prints items
  • 10. Clear distinction between mutable and immutable data val msg = “Hello,world!” // constant var value = 3 // variable scala.collection scala.collection.immutable scala.collection.mutable
  • 11. Named and default parameters class Person(name: String = "Goofy", age: Int = 30, location: String = "Milano") Person(name = "Mario", age = 36, location = "Lugano") Person(age = 36, location = "Lugano", name = "Mario") Person(age = 36, name = "Mario") Person(age = 36) Person()
  • 12. Operator overloading class Rational (n: Int, d: Int) { def this(n: Int) = this(n, 1) def + (that: Rational): Rational = new Rational(n * that.d + that.n * d, d * that.d) def + (i: Int): Rational = new Rational(n + i * d, d) }
  • 13. Implicit conversion val a = new Rational(2, 3) val b = a + 2 // = 8/3 val c = 2 + a // Compilation Error implicit def intToRational(x: Int) = new Rational(x) Val c = 2 + a // = 8/3
  • 14. Options Tony Hoare, who invented the null reference in 1965 while working on an object oriented language called ALGOL W, called its invention his “billion dollar mistake” val capitals = Map("Italy" -> "Rome", "Switzerland" -> "Bern", "Germany" -> "Berlin" , "France" -> "Paris") println(capitals.get("Italy")) // Some(Rome) println(capitals.get("Spain")) // None println(capitals.get("Italy").get) // Rome println(capitals.get("Spain").get) // thorws Exception println(capitals.get("Spain").getOrElse("Unknown")) // Unknown
  • 15. Traits class Animal { def eat(): Unit } trait Mammal extends Animal { def giveBirth(): Mammal } trait HasWings extends Animal { def fly(): Unit } trait HasLegs extends Animal { def walk(): Unit } class Snake extends Animal class Frog extends Animal with HasLegs class Cat extends Animal with Mammal with HasLegs class Bat extends Animal with Mammal with HasWings class Chimera extends Animal with Mammal with HasWings with HasLegs
  • 16. Case classes trait Expr case class Var(name: String) extends Expr case class Number(num: Double) extends Expr case class Unop(op: String, arg: Expr) extends Expr case class Binop(op: String, l: Expr, r: Expr) extends Expr
  • 17. Pattern matching def simplify(expr: Expr): Expr = expr match { case Unop("-", Unop("-", e)) => e // Double negation case Binop("+", e, Number(0)) => e // Adding zero case Binop("*", e, Number(1)) => e // Multiplying by one case _ => expr } // Simplify double negation: simplified = Var("x") val simplified = simplify(Unop("-", Unop("-", Var("x"))))
  • 18. Structural Typing (duck typing done right) class Duck { quack() { println "quack" } } doQuack(new Duck) doQuack(d) { d.quack() } class Dog { barf() { println "barf" } } doQuack(new Dog) def doQuack(d:{ def quack():Unit }) = d.quack() class Duck { def quack() = println "quack" } doQuack(new Duck) class Dog { def barf() = println "barf" } doQuack(new Dog)runtime error compilation error Duck typing is the dynamic mechanism that allows to discover a dog cannot say quack only at runtime... in production ... on friday evening
  • 19. Actors val printerActor = actor { loop { receive { case s: String => println("I got a String: " + s) case i: Int => println("I got an Int: " + i.toString) case _ => println(" I don’t know what I got ") } } } printerActor ! "hi there“ // prints “I got a String: hi there” printerActor ! 23 // prints “I got an Int: 23” printerActor ! 3.33 // prints “I don’t know what I got”
  • 21. Who is using Scala ?
  • 22. Norbert by LinkedIn • Norbert is a framework written in Scala that allows to write asynchronous, message based, client/server applications • Built on Apache ZooKeeper and JBoss Netty, Norbert to make it easy to build a cluster aware application • Provides out of the box support for notifications of cluster topology changes, application specific routing, load balancing and partitioned workload
  • 23. • Akka is a framework that allows to write simpler concurrent (yet correct) applications • It provides a higher level of abstraction for writing concurrent and distributed systems through (remote) actors • It implements Software Transactional Memory (STM) turning the Java heap into a transactional data set with begin/commit/rollback semantic • Fault-tolerant adopting the "Let it crash" / "Embrace failure" model
  • 24. SBT (simple-build-tool) • Sbt is a build tool written in Scala • Uses the same directory structure as Maven for source files • Uses Ivy to resolve dependencies • Compatible with Maven configuration files • Supports testing with ScalaTest • Parallel task execution, including parallel test execution
  • 25. Happy Scala programming! Thanks a lot Mario Fusco mario.fusco@gmail.com Twitter: @mariofusco