SlideShare a Scribd company logo
1 of 109
Download to read offline
Peter Pilgrim
Oracle Java Champion
INTRODUCTION INTO SCALA 
THE OBJECT‐FUNCTIONAL 
PROGRAMMING LANGUAGE
                       XeNoNiQUe.co.uk (c) 2011   4/14/2011   1
Blog: www.XeNoNiQUe.co.uk/blog/
ACCU: Member since 1993
Education: London South Bank University
Languages: Scala, Groovy, JavaFX, Java
Conferences: JavaOne, ACCU, QCon, Devoxx


             XeNoNiQUe.co.uk (c) 2011   4/14/2011   2
“If I were a pick a language 
to use today other than 
Java, it would be Scala”
                                 James Gosling




http://www.adam‐bien.com/roller/abien/entry/java_net_javaone_which_programming


                                                          XeNoNiQUe.co.uk (c) 2011   4/14/2011   3
Headline News

 “More and more programmers are going to need to 
 understand functional programming at a productive 
 level. Especially over the next 5 to 10 years” ‐ IBM, Jason 
 Stidd, Functional Programming Blog, 2010
 “Scala enjoys a singular advantage: performance. The 
 language is compiled to optimised byte codes and runs 
 as fast as native Java” Infoworld, 2010




                              XeNoNiQUe.co.uk (c) 2011   4/14/2011   4
Demo

  XeNoNiQUe.co.uk (c) 2011   4/14/2011   5
Today’s Agenda

 Classes and Companion Objects
 Function Objects
 Case classes and Pattern matching
 Traits, Mix‐ins and Compositions
 Scala Collections
 Library Frameworks



                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   6
The Basics




        XeNoNiQUe.co.uk (c) 2011   4/14/2011   7
Scalable Language




              Very Bright Future
Functional
                             Purely Object Oriented
     Statically Typed
                                JVM Language

                        XeNoNiQUe.co.uk (c) 2011   4/14/2011   8
Martin Odersky ‐ Language Designer




                  XeNoNiQUe.co.uk (c) 2011   4/14/2011   9
A Brief History of Scala

             Make Java Better 
 1996 – 2000: Pizza, GJ and javac


            Make a Better Java
 2003 : The Scala 1.0 Experiment
 2005 : Scala 2.0, written in Scala
 2006‐2011:  Industrial strength 


                          XeNoNiQUe.co.uk (c) 2011   4/14/2011   10
A Java Class
public class Person {
  public final String firstName, lastName;
  public final float height;
  public final int age;

    public Person( String firstName,
        String lastName,
        float height, int age ) {
        this.firstName; this.lastName = lastName;
        this.height = height; this.age = age;
    }
}
                            XeNoNiQUe.co.uk (c) 2011   4/14/2011   11
Equivalent Scala class
class   Person (
  val   firstName: String
  val   lastName: String,
  val   height: Float,
  val   age: Int ) { }




                    XeNoNiQUe.co.uk (c) 2011   4/14/2011   12
Filtering Data with Java
import java.util.ArrayList;
Person[] people = getPeople();
Person[] tallFolk;
Person[] shortFolk;
{
   ArrayList<Person> tallList = new ArrayList<Person>();
   ArrayList<Person> shortList = new ArrayList<Person>();
   for ( int j=0; j<people.length; ++j) {
       (people[j].height < 5.0 ? shortList : tallList )
              .add( people[j] );
   }
   shortFolk = smallList.toArray( people );
   tallFolk = tallList.toArray( people );
}

                             XeNoNiQUe.co.uk (c) 2011   4/14/2011   13
And in Scala
val people: Array[Person] = getPeople()

// Type inference
val ( smallFolk, bigFolk ) =
  people partition ( _.height < 5.0 )




                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   14
Semicolon is optional


            XeNoNiQUe.co.uk (c) 2011   4/14/2011   15
Vals
                                 and 
                                 Vars

XeNoNiQUe.co.uk (c) 2011   4/14/2011   16
Variables
Two Types of variables:
  val     a immutable variable
  var     a re‐assignable variable

val s1 = “Purple Haze” // Type inference String
var s2 = “Barcelo”
s1 = “Hotel” // Won’t compile
s2 = “Electricona” // Ok!



                        XeNoNiQUe.co.uk (c) 2011   4/14/2011   17
Variables Type Inferences
val s3: String = “Purple Haze”
val f1: Double = 3.141596527
val fruit = List(“orange”,”apple”)
  // scala.collection.immutable.List[String]
val capitals = Map(“USA”-> “Washington”,
      ”Wales” -> “Cardiff”, “Germany” -> “Berlin”
  )
  // scala.collection.immutable.Map[String, String]




                             XeNoNiQUe.co.uk (c) 2011   4/14/2011   18
Scope
val s1 = “Purple   Haze”
{
   val s1 = “Day   Tripper”
   println( s1 )   // "Day Tripper"
}
println( s1 ) //   "Purple Haze"



                    XeNoNiQUe.co.uk (c) 2011   4/14/2011   19
Scala Identifiers

Four forms of Scala identifiers
  Alphanumeric: A letter followed by a sequence of 
  letters or digits
    _ count as a letter (but single _ is reserved)
    $ is reserved for system use
  Operator: One of more symbolic characters such 
  + , *, /, ‐ , %, #, !
  Mixed: gamma_!
  Quoted: any character sequence in back‐quotes: 
  `yield`

                              XeNoNiQUe.co.uk (c) 2011   4/14/2011   20
Basic Scala Literals
 Integer:       1, 882, ‐1
 Boolean:       true, false
 Double:        1.0, 1d, 1e3, 1.234e‐6
 Long:          42L
 Float:         19.73f
 Characters:    ‘6’, ‘@’, ‘?’, `K’
 String:        “Hello world” 


                       XeNoNiQUe.co.uk (c) 2011   4/14/2011   21
Express
                                   Yourself

XeNoNiQUe.co.uk (c) 2011   4/14/2011          22
Expressions == Results
val msg = “Macro Economics”
val hasA =
  if ( msg contains ‘a’)
     “yes”
  else
     “no”
println(hasA) // “yes”



                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   23
Expressions On Everything
val z1 =
  try {
     “play havoc”
  }
  finally {
     “yes”
  }
// z1 is “yes”


                    XeNoNiQUe.co.uk (c) 2011   4/14/2011   24
Expressions Initialise Vals
val powerSeries = {
  var x = 2.0;
  var sum = 1.0
  for ( c <- 1 to 7 ) yield {
     sum += x; x = x * x; sum
  }
}
// scala.collection.immutable.IndexedSeq[Double]
  = Vector(3.0, 7.0, 23.0, 279.0, 65815.0,
  4.295033111E9, 1.8446744078004584E19)


                        XeNoNiQUe.co.uk (c) 2011   4/14/2011   25
How To Declare Functions
def volumePrice( price: Float, vol: Int ): Float = {
    if ( vol >= 1000 )
       price * 0.90
    else if ( vol >= 100 )
       price * 0.95
    else
       price
}




                             XeNoNiQUe.co.uk (c) 2011   4/14/2011   26
Functions Written Concisely
def max( x: Double, y: Double ): Double
   = if ( x > y) x else y


def min( x: Double, y: Double ): Double
   = if ( x < y) y else x


// type inference on the return type: Double
def cube( x: Double ) = x * x * x




                            XeNoNiQUe.co.uk (c) 2011   4/14/2011   27
Procedures and The Unit Type
def sideEffect(): Unit = println(“Say hi!”)
// sayHi: ()Unit


sideEffect()          // prints “Say hi!”


• Unit has a value, written as ()
• Unit roughly corresponds to void in Java




                               XeNoNiQUe.co.uk (c) 2011   4/14/2011   28
Classes



    XeNoNiQUe.co.uk (c) 2011   4/14/2011   29
How To Declare Classes
class Foo
val f1 = new Foo()
val f2 = new Foo


class Bar ( val name: String )
val b1 = new Bar(“Twix”)
val b2 = new Bar(“Curly-Wurly”)




                           XeNoNiQUe.co.uk (c) 2011   4/14/2011   30
The Primary Constructor
class Person (
    val firstName: String
    val lastName: String,
    val height: Float,
    val age: Int ) {
    if ( age < 0 )
       throw new Exception("age?")
    if ( height <= 0.5 )
       throw new Exception("height?")
}


                            XeNoNiQUe.co.uk (c) 2011   4/14/2011   31
Class ‐ Better Style
class Person (
    val firstName: String, val lastName: String,
    val height: Float, val age: Int ) {
    require( age > 0, "age > 0" )
    require( height >= 0.5, "height >= 0.5" )


    override def toString = "%s %s %3d %5.2f (ft)".
       format( firstName, lastName,
              age, height )
}


                              XeNoNiQUe.co.uk (c) 2011   4/14/2011   32
Class ‐ Auxiliary Constructors
class Complex( real: Float, imag: Float {
    def this() = this(0)
    def this( r: Float ) = this ( r, 0 )
    def this( r: String ) =
       this ( java.lang.Float.parseFloat(r), 0 );
    def this( r: String, i: String ) =
       this ( java.lang.Float.parseFloat(r),
              java.lang.Float.parseFloat(i) )
    // ...
}


                              XeNoNiQUe.co.uk (c) 2011   4/14/2011   33
Built‐In Control Structures #1

var x1 = 3.0
var r1 = if ( x1 >= 0 )
  "positive" else "negative"

x1 = -9.25
println( if ( x1 < 0 )
  "negative" else "positive" )



                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   34
Built‐In Control Structures #2

While ... Do           Do ... While
var c1 = 0             var c2 = 0
var y1 = ""            var y2 = ""
while ( c1 < 4 ) {     do {
  y1 = y1 + "#" + c1     y2 = y2 + "#" + c2
  c1 += 1                c2 += 1
}                      }
println(y2)            while ( c2 < 4 )
                       println(y2)

                       XeNoNiQUe.co.uk (c) 2011   4/14/2011   35
Scala Fixes Java Mishaps

Scala Removes             Scala Innovates
  Break and Continue          Operator overloading
  Static members              Function objects
  Primitive types             Companion Objects
  Special treatment of        Case classes
  interfaces                  User control abstractions
                              Mix‐ins
                              Pattern matching
                              Implicit conversions

                          XeNoNiQUe.co.uk (c) 2011   4/14/2011   36
Infix Operators in Classes
class Complex( val re:Float, val im: Float ) {
    def +( x:Complex ): Complex = {
        new Complex( this.re + x.re, this.im + x.im )
    }
    def -( x:Complex ): Complex = {
        new Complex( this.re - x.re, this.im - x.im )
    }
    // ...
    override def toString = re +
        (if (im < 0 ) "-" +(-im) else "+" +im )+"i"
}

                            XeNoNiQUe.co.uk (c) 2011   4/14/2011   37
Using Operator Overloading
val   z1   =   new Complex(3,4)
val   z2   =   new Complex(1,2)
val   z3   =   z1 + z2    // = z1.+(z2)
val   z4   =   z1 * z2    // = z1.*(z2)
val   z5   =   z1 - z2    // = z1.-(z2)
val   z6   =   z1 / z2    // = z1./(z2)




                           XeNoNiQUe.co.uk (c) 2011   4/14/2011   38
Infix Operator Associativity
Normally expressions associate from LEFT to RIGHT
val x = 1 + 2 + 3 + 4
val x = ((1 + 2) + 3 ) + 4

Except for those operators that end with a colon(:) 
They associate from RIGHT to LEFT
val list = 1 :: 2 :: 3 :: 4 :: Nil
val list = 1 :: ( 2 :: ( 3 :: (4 :: Nil )))




                              XeNoNiQUe.co.uk (c) 2011   4/14/2011   39
Companion Objects
• Represents a single instance of a class
• Serves the analogous role of “static” in Java
• Frequently defines two methods apply() and 
    unapply() for factories and extraction


object Complex {
  val i = new Complex( 0, 1 )

    def apply( re: Float, im: Float ) =
       new Complex( re, im )
}

                          XeNoNiQUe.co.uk (c) 2011   4/14/2011   40
Comprehensions
   XeNoNiQUe.co.uk (c) 2011   4/14/2011   41
For‐Loop Expressions
for ( j <- 1 to 4 )
  println( "Iteration "+j )
// Iteration 1 .. 4

for ( j <- 1 until 4 )
  println( "Iteration "+j )
// Iteration 1 .. 3



                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   42
Looping Over Collections

val fruits = List("apple",
  "orange","pear",
  "kiwi", "plum" )
for ( fruit <- fruits )
  println( fruit )



                XeNoNiQUe.co.uk (c) 2011   4/14/2011   43
For‐Filter Comprehensions
for ( trade <- trades
  if trade.tradeType == "FX" &&
  trade.amount >= 75000 &&
  trade.counterparty.toUpperCase
     .startsWith("North")
)
  processLayerDown( trade )



                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   44
For‐Nested‐Filter Comprehension

for ( trade <- trades
  if trade.tradeType == "MM" ;
  if trade.origin == "Summit";
  settlement <- trade.settlements
  settlement.exists( _.name == Standard )
)
  settleStandard( settlement )



                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   45
Function Objects




        XeNoNiQUe.co.uk (c) 2011   4/14/2011   46
Function Object ‐ Long Hand
val isEven = new Function1 [ Int, Boolean ] {
    def apply( k: Int ) = k % 2 == 0
}

Syntactic definition for function type that:
• Accepts an Integer parameter
• Returns a Boolean value
• Defines a method called apply to invoke the
  function definition.




                            XeNoNiQUe.co.uk (c) 2011   4/14/2011   47
First‐Class Functions

val isEven: (Int => Boolean) = (k: Int) => k % 2 == 0




// The verbose short‐hand notion


Functions are values, values are object
Ergo, functions are objects in Scala




                          XeNoNiQUe.co.uk (c) 2011   4/14/2011   48
First‐Class Functions

val isEven = (k: Int ) => k % 2 == 0



// The short‐hand notion 
// Scala infers the function type for the LHS




                        XeNoNiQUe.co.uk (c) 2011   4/14/2011   49
Calling Function Objects
isEven.apply(24)                              // true

isEven(11)                                    // false




                   XeNoNiQUe.co.uk (c) 2011   4/14/2011   50
Filter Out Even Numbers
val numbers = List(0,1,2,3,4,5,6,7)
// List[Int] = List(0,1,2,3,4,5,6,7)

numbers.filter( isEven )
// List[Int] = List(0,2,4,6)

Apply the function object isEven to all
  members of the sequence


                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   51
Filter Out Even Numbers
val numbers = List(0,1,2,3,4,5,6,7)

numbers.filter( (k: Int) => k % 2 == 0 )
// in-lined function value:
// List[Int] = List(0,2,4,6)




                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   52
Filter Out Even Numbers
val numbers = List(0,1,2,3,4,5,6,7)

numbers.filter( k => k % 2 == 0 )
// 0,2,4,6




                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   53
Filter Out Even Numbers
val numbers = List(0,1,2,3,4,5,6,7)

numbers.filter( _ % 2 == 0 )
// 0,2,4,6




                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   54
Function Object Summary



 ( x: Float ) => sin(pi * x)
         / (pi * x )




              XeNoNiQUe.co.uk (c) 2011   4/14/2011   55
Closures



( x: Float ) => extra +
    sin(pi * x) / (pi * x )




              XeNoNiQUe.co.uk (c) 2011   4/14/2011   56
Real World Closures
var extra = computeFudgeFactor()

reactions += {
   case e:MouseClicked =>
      plotXY( -1.0, 1.0, -2.0, 2.0,
             ( x: Float ) =>
                    extra + sin(pi * x) / (pi * x ) )
}

The variable extra defined in the enclosing scope is
  bounded to the lexical scope of the function
  object.

                           XeNoNiQUe.co.uk (c) 2011   4/14/2011   57
Closure Lexical Scope
var extra = 4
val addExtra = (x: Int) => x + extra

addExtra(2)   // 6
extra = 7
addExtra(2)   // 9



                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   58
Curried Functions



  ( x: Float )( y: Float ) =>
   y * cos ( sin (pi * x ) )




               XeNoNiQUe.co.uk (c) 2011   4/14/2011   59
Functions Can Return Functions

def foo1( x: Float)(y: Float ) = x*y-2*x

def foo1( x: Float) = { (y: Float ) => x*y-2*x }

val a1 = foo1( 3 ) ( 4 )              // a1 is 6.0

val a2 = foo1( 3 )
  // a2 is (Float) => Float = <function1>
val a3 = a2(4)               // a3 = 6.0


                           XeNoNiQUe.co.uk (c) 2011   4/14/2011   60
Parameterised Types

class Holder [T] ( val value: T )


val chipBox = new Holder( 555 )
val z1 = chipBox.value      // 555


val fruitBox = new Holder( "apple" )
val z2 = fruitBox.value     // “apple”


fruitBox.value = "orange"               // re-assign error
chipBox.value = 73                      // re-assign error

                             XeNoNiQUe.co.uk (c) 2011   4/14/2011   61
Call‐By‐Value versus Call‐By‐Name


Call By Value                  Call By Name
  Expression are evaluated         Expressions are evaluated 
  before being passed as a         inside the function
  parameter to a function               Computational nice
                                        Useful for library writers to  
                                        create custom control 
                                        abstractions 


def debug( s: String ):Unit    def debug( s:  => String ):Unit



                               XeNoNiQUe.co.uk (c) 2011   4/14/2011       62
Custom Control Abstractions
def using[ T <: { def close() }, A ]
    ( closable: T ) ( body: T => A ) = {
    try {
        body( closable )
    } finally {
        if ( closable != null ) {
            try { closable.close() } catch {
                case e: Exception => // Log this error
            }
        }
    }
}
                              XeNoNiQUe.co.uk (c) 2011   4/14/2011   63
Closures As Control Abstraction
import java.io._
val file = new File( "poem.txt" )

using(
  new BufferedReader(
     new FileReader( file )) ) {
  r => println( r.readLine() )
}


                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   64
Pattern Matching

   XeNoNiQUe.co.uk (c) 2011   4/14/2011   65
Case Classes

 Convenience data types for pattern matching
 Scala compiler creates :
  Class with hashCode(), equalsTo(), copy() methods
  Nice toString() method
  Defaults to immutable data members
  Companion object 
    Defines apply() and unapply() (extractor) methods




                          XeNoNiQUe.co.uk (c) 2011   4/14/2011   66
Case Classes
case class Stock( name: String, size: Int )


val st1 = Stock( "EDH", 15000 )
val st2 = Stock( “XNF", 40000 )
val nameAndValue = st2.name + “ “ +st1.value
      // “EDH 15000”
val st3 = st2.copy()
val st4 = st3.copy( name = "AXA")


assert( st2 == st3 )     // true
assert( st2 != st4 )     // true

                           XeNoNiQUe.co.uk (c) 2011   4/14/2011   67
Pattern Matching on Types
val list = List( 1967, "Legacy", '£', 51.50F )


for ( e <- list ) {
    e match {
        case f: Float => println("A decimal "+f )
        case s: String => println("A string "+s )
        case c: Char => println("A character "+c )
        case _ => println("I do not know “+e )
    }
}


                              XeNoNiQUe.co.uk (c) 2011   4/14/2011   68
Pattern Matching on Sequences
val list = List( 1967, "Legacy", '£', 51.50F )

list match {
    case 1967 :: _ :: ‘£’ :: _ => println("got it")
    case _ => println("not found" )
}

list match {
  case List( 1967, "Legacy", _* ) => println("got
  two" )
  case _ => println("not found")
}

                           XeNoNiQUe.co.uk (c) 2011   4/14/2011   69
Pattern Matching Algorithms
def fib( n: Int ): Long = {
    n match {
        case 0 => 0
        case 1 => 1
        case n => fib(n-2) + fib(n-1)
    }
}


val z1 = fib(3) // 2


val series = (0 to 25).map( fib _ ).mkString("n")

                            XeNoNiQUe.co.uk (c) 2011   4/14/2011   70
Case Classes Abstract Data Types

abstract class BinTree[T]

case object Empty extends BinTree

case class Node (
  elem: T, left: BinTree[T], right: BinTree[T]
) extends BinTree




                        XeNoNiQUe.co.uk (c) 2011   4/14/2011   71
Pattern Matching Algorithm
// Traverse tree in-order by algorithmic cases
def inOrder[T]( n: BinTree[T] ) : List[T] = {
  n match {
      case Empty => List()
      case BinTree(e,l,r) =>
            inOrder(l) ::: List(e) ::: inOrder(r)
  }
}




                        XeNoNiQUe.co.uk (c) 2011   4/14/2011   72
Pattern Matching Algorithm
// Recursively find the depth of the binary tree
def depth[T]( n: BinTree[T] ): Int = {
  n match {
      case Empty => 0
      case Node( _, Empty, r ) => 1 + depth(r)
      case Node( _, l, Empty ) => 1 + depth(l)
      case Node( _, l, r ) =>
            Math.max( depth(l), depth(r)) + 1
  }
}

                        XeNoNiQUe.co.uk (c) 2011   4/14/2011   73
Composition




      XeNoNiQUe.co.uk (c) 2011   4/14/2011   74
Traits and Mix‐ins

 Trait is provides composition of behaviour 
 type in Scala
 Traits can define abstract methods
 Traits can define implementation methods
 Traits can define data members
 Linearisation of behaviour is prioritised from 
 left to right
 Traits can inherit from other traits

                       XeNoNiQUe.co.uk (c) 2011   4/14/2011   75
Mix‐Ins and Traits
trait   Vehicle
trait   Car extends Vehicle
trait   Bicycle extends Vehicle
trait   Motorcycle extends Vehicle
trait   Powered
trait   HasWheels




                       XeNoNiQUe.co.uk (c) 2011   4/14/2011   76
Mix‐In Composition
class Ford extends Car with Powered with HasWheels


class Chopper extends Bicycle with HasWheels


val myCar = new Ford
val myBike = new Chopper




                           XeNoNiQUe.co.uk (c) 2011   4/14/2011   77
Mix‐Ins Refactored
trait Powered {
    def kickdown() = "Vrroom!!"
}


trait HasWheels {
    def turn() = "Wheels are turning"
}




                            XeNoNiQUe.co.uk (c) 2011   4/14/2011   78
Mix‐ins Refactored #2
trait Vehicle
trait Car extends Vehicle with HasWheels
   with Powered
trait Bicycle extends Vehicle with HasWheels
trait Motorcycle extends Vehicle with HasWheels
   with Powered


trait Bus extends Car
trait Truck extends Car
trait SUV extends Car


                           XeNoNiQUe.co.uk (c) 2011   4/14/2011   79
Motorway Responsibility
def motorway( x: Vehicle with Powered ) =
  println( "on the motorway: " +x.kickdown )


val aCar = new Ford
val aBike = new Chopper


motorway( aCar ) // Ok
motorway( aBike ) // Won’t compile!




                          XeNoNiQUe.co.uk (c) 2011   4/14/2011   80
Collections



      XeNoNiQUe.co.uk (c) 2011   4/14/2011   81
Immutable Lists
scala.collection.immutable.List


• Insertion at front                            O(1)
• Insertion at end                              O(n)




                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   82
Creating List Collections
import scala.collection.immutable.List

val xs0 = List(1,2,3,4)

val xs1 = 1 :: 2 :: 3 :: 4 :: Nil




                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   83
Creating Nested Lists
val xs2 = ( 1 :: 2 :: 3 :: Nil) ::
  ( 4 :: 5 :: Nil ) ::
  ( 6 :: Nil ) ::
  Nil

// xs2: List[List[Int]] =
  List(List(1, 2, 3), List(4, 5), List(6))




                        XeNoNiQUe.co.uk (c) 2011   4/14/2011   84
List Functions
val list = List(1,2,3,4,5)


val z0 = list.head       // 1
val z1 = list.tail       // List(2,3,4)
val z2 = list.isEmpty    // false
val z3 = list.size       // 4




                             XeNoNiQUe.co.uk (c) 2011   4/14/2011   85
Higher Order Operations
val list = List(1,2,3,4,5)


val z0 = list.last                      // Int 5
val z1 = list.map( _ +    3 )           // List( 4,5,6,7,8 )
val z2 = list.take( 2 )                 // List(1,2)
val z3 = list.drop( 2 )                 // List(3,4,5)
val z4 = list.slice( 2,4 )              // List(3,4)
val z5 = list.reverse                   // List(5,4,3,2,1)
val z7 = list.contains(3)               // true
val z8 = list.filter( _ < 3 )           // List( 1,2 )


                             XeNoNiQUe.co.uk (c) 2011   4/14/2011   86
Sorting List Collections
val xs = List( 11, 7, 2, 15, 9, 1 )

val x0 = xs.sort( _ < _ )
  // List[Int](1, 2, 7, 9, 11, 15)

val x1 = xs.sort( _ > _ )
  // List[Int](15, 11, 9, 7, 2, 1)



                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   87
More Higher Operations
val xs = List( "apple", “plum", "orange" )
val z0 = xs.zipWithIndex
  // List((apple,0), (plum,1), (orange,2))


val ys = List( "usa", "uk", "france" )
val z1 = xs zip ys
  // List((apple,usa), (plum,uk), (orange,france))


val zs = List( List(1,2,3), List(4,5), List(6))
val z2 = zs flatten
  // List(1, 2, 3, 4, 5, 6)

                           XeNoNiQUe.co.uk (c) 2011   4/14/2011   88
Map Collections Types
var capitals = Map( "England" -> "London",
    "Scotland" -> "Edinburgh", "Wales" -> "Cardiff",
  "Northern Ireland" -> "Belfast" )


capitals += ( "Brasil" -> "Brasilia" )
val z0 = capitals( "Brasil“ )          // “Brasilia”
val z1 = capitals.isEmpty              // false
val z2 = capitals.size                 // 4


for ( (k,v) <- capitals )
  println("Capital of "+k+" is "+v )

                            XeNoNiQUe.co.uk (c) 2011   4/14/2011   89
Set Collections Types
import scala.collection.immutable.SortedSet
var xs = SortedSet( 3,2,1 )
println(xs)       // TreeSet(1,2,3 )
xs += 4
xs += 3
println(xs)       // TreeSet(1,2,3,4 )
xs -= 2
println(xs)       // TreeSet(1,3,4 )
xs ++= List( 5,6)
println(xs)       // TreeSet(1,2,4,5,6 )

                        XeNoNiQUe.co.uk (c) 2011   4/14/2011   90
Implicit Conversions

“Can you make an ADT from a library and make 
  it look just like it is part of the language?”,
  Guy Steele, Benchmark of Languages

  Implicit informs the compiler about a custom 
  default conversion method
  Power enabler for writing embedded DSL in 
  Scala

                        XeNoNiQUe.co.uk (c) 2011   4/14/2011   91
Declare Implicit Conversions
object Complex {
    implicit def doubleToComplex( x: Double ) =
       new Complex( x, 0 )


    val i = new Complex( 0, 1 )


    def apply( re: Float, im: Float ) =
       new Complex( re, im )
}




                             XeNoNiQUe.co.uk (c) 2011   4/14/2011   92
Using Implicit Conversion
import xenonique.numerics.Complex

val   z1   =   new Complex( 4.7, -2.3 )
val   z4   =   2 + c1
val   z2   =   2.50 * c1
val   z3   =   (2.50).*(c1)



                        XeNoNiQUe.co.uk (c) 2011   4/14/2011   93
Tools



        XeNoNiQUe.co.uk (c) 2011   4/14/2011   94
Builders

Scala – Launcher / REPL
Scalac ‐ Compiler
Scaladoc – Documentation Generator
SBT ‐ Simple Build Tool 
Maven Scala Plug‐in
Apache Ant Plug‐In
Gradle

                      XeNoNiQUe.co.uk (c) 2011   4/14/2011   95
Tools ‐ IDEs

Intellij IDEA v10.2
Eclipse Helios v3.6
Net Beans v7.0
Emacs
JEdit, NotePad++, TextPad, TextMate




                            XeNoNiQUe.co.uk (c) 2011   4/14/2011   96
Tools ‐ Frameworks

Testing       Domain Specific

Scala Test    Lift 
Specs         Akka
Scala Check   Play!
              Camel DSL
              Wicket
              Squeryl, Pinky, Sweet

              XeNoNiQUe.co.uk (c) 2011   4/14/2011   97
End Game
  XeNoNiQUe.co.uk (c) 2011   4/14/2011   98
Breaking The Mono‐Culture

“Do not throw the baby out with the bath water 
by clinging to a Java‐only monoculture approach: 
it matters not that what current systems are 
written in, when running on the JVM, only what 
happens in the future”
          Dr. Russel Winder, Consultant
http://groups.google.com/group/javaposse
Thread: “Your Experience of Alternative JVM Languages 
in Organisations, Divisions and Teams”




                                                 XeNoNiQUe.co.uk (c) 2011   4/14/2011   99
Beyond Java Today




              XeNoNiQUe.co.uk (c) 2011   4/14/2011   100
Beyond Java Future 2016?




              XeNoNiQUe.co.uk (c) 2011   4/14/2011   101
Scalable Language




                Powerful
Comprehensive
                                Deep Language
     Responsible
                                   Expressive Concise

                           XeNoNiQUe.co.uk (c) 2011   4/14/2011   102
Learn more

  http://xenonique.co.uk/blog/
  peter.pilgrim@gmail.com
  http://scala‐lang.org/
  twitter:peter_pilgrim


              XeNoNiQUe.co.uk (c) 2011   4/14/2011   103
Professional Services


    peter.pilgrim@gmail.com
    Scala Adoption in Enterprises
    Contracting
    Training with Consultancy
    Technical Leadership

                 XeNoNiQUe.co.uk (c) 2011   4/14/2011   104
Introduction to Scala
The Object‐Functional Programming Language


Peter Pilgrim
Java Champion ‐Java EE specialist w/ Scala enthusiasm
XeNoNiQUe.co.uk/blog




                                   XeNoNiQUe.co.uk (c) 2011   4/14/2011   105
Recommended References
 Programming in Scala by Martin Odersky, Lex Spoon, Bill Venners ; Artima; 
 2nd Edition 2010 http://www.artima.com/shop/programming_in_scala
 Programming Scala by Wampler, Payne; O’Reilly; 2010; http://programming‐
 scala.labs.oreilly.com/
 Beginning Scala by David Pollak; Apress; 2009; 
 http://www.apress.com/book/view/1430219890
 Steps in Scala by Loverdos , Syropoulos; Cambridge Univ Press; 2010; 




                                     XeNoNiQUe.co.uk (c) 2011   4/14/2011     106
Popular Scala Frameworks
 Scala Test  http://www.scalatest.org/
 Scala Check https://www.ohloh.net/p/scalacheck
 Lift http://www.liftweb.net/
 Akka http://akka.io/
 Play! Scala module http://www.playframework.org/modules/scala
 Camel DSL http://camel.apache.org/scala‐dsl.html
 Squeryl http://squeryl.org/
 Pinky https://github.com/pk11/pinky/wiki
 Sweet [Scala] http://code.google.com/p/sweetscala/




                                     XeNoNiQUe.co.uk (c) 2011   4/14/2011   107
Attributions
All images are Creative Commons (CC) License  from Flickr.com
– “You must attribute the source and you cannot change the content”

Tim Ellis http://www.flickr.com/photos/tim_ellis/
Lego Basics http://www.flickr.com/photos/tim_ellis/338755101/sizes/l/


*PaysImaginaire*  http://www.flickr.com/photos/nevrlndtink/
Variable Plastic Bag http://www.flickr.com/photos/nevrlndtink/232906118/sizes/m/


~Deiby http://www.flickr.com/photos/deiby/
Expression http://www.flickr.com/photos/deiby/5489382677/sizes/l/


Lisa Sinclair http://www.flickr.com/photos/plumandjello/
fruit http://www.flickr.com/photos/plumandjello/2333263539/sizes/l/


Nerovivo http://www.flickr.com/photos/dominik99/
http://www.flickr.com/photos/dominik99/407716865/sizes/z/in/photostream/

                                                            XeNoNiQUe.co.uk (c) 2011   4/14/2011   108
Attributions
All images are Creative Commons (CC) License  from Flickr.com
– “You must attribute the source and you cannot change the content”

.Guilty http://www.flickr.com/photos/roll_initiative/
Arbitrary Function Generator http://www.flickr.com/photos/roll_initiative/3278642272/


Loop Oh Rupert Grazer http://www.flickr.com/photos/loop_oh/
Pattern at the Senckenberg Museum in Frankfurt am Main / Germany. http://www.flickr.com/photos/loop_oh/4571485915/


Lili Vieira de Carvalho, Vancouver, Canada http://www.flickr.com/people/lilivc/
Composition of Bowls http://www.flickr.com/photos/lilivc/367582911/sizes/l/


Mykl Roventine http://www.flickr.com/people/myklroventine/
19/365 Game Over http://www.flickr.com/photos/myklroventine/3210068573/sizes/l/


superciliousness / Bentley Smith http://www.flickr.com/people/superciliousness/
200510 carpenter's tools ‐ inside the workman's shed ‐ all his old tools http://www.flickr.com/photos/superciliousness/57486288/



                                                                  XeNoNiQUe.co.uk (c) 2011     4/14/2011                           109

More Related Content

What's hot

Future vs. Monix Task
Future vs. Monix TaskFuture vs. Monix Task
Future vs. Monix TaskHermann Hueck
 
Quark: A Purely-Functional Scala DSL for Data Processing & Analytics
Quark: A Purely-Functional Scala DSL for Data Processing & AnalyticsQuark: A Purely-Functional Scala DSL for Data Processing & Analytics
Quark: A Purely-Functional Scala DSL for Data Processing & AnalyticsJohn De Goes
 
First-Class Patterns
First-Class PatternsFirst-Class Patterns
First-Class PatternsJohn De Goes
 
Collection v3
Collection v3Collection v3
Collection v3Sunil OS
 
[Codemotion 2015] patrones de diseño con java8
[Codemotion 2015] patrones de diseño con java8[Codemotion 2015] patrones de diseño con java8
[Codemotion 2015] patrones de diseño con java8Alonso Torres
 
Implementing the IO Monad in Scala
Implementing the IO Monad in ScalaImplementing the IO Monad in Scala
Implementing the IO Monad in ScalaHermann Hueck
 
Scala traits training by Sanjeev Kumar @Kick Start Scala traits & Play, organ...
Scala traits training by Sanjeev Kumar @Kick Start Scala traits & Play, organ...Scala traits training by Sanjeev Kumar @Kick Start Scala traits & Play, organ...
Scala traits training by Sanjeev Kumar @Kick Start Scala traits & Play, organ...Sanjeev_Knoldus
 
Chapter i(introduction to java)
Chapter i(introduction to java)Chapter i(introduction to java)
Chapter i(introduction to java)Chhom Karath
 
Functor, Apply, Applicative And Monad
Functor, Apply, Applicative And MonadFunctor, Apply, Applicative And Monad
Functor, Apply, Applicative And MonadOliver Daff
 
From Functor Composition to Monad Transformers
From Functor Composition to Monad TransformersFrom Functor Composition to Monad Transformers
From Functor Composition to Monad TransformersHermann Hueck
 
ScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin OderskyScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin OderskyTypesafe
 

What's hot (18)

Getting Started With Scala
Getting Started With ScalaGetting Started With Scala
Getting Started With Scala
 
Future vs. Monix Task
Future vs. Monix TaskFuture vs. Monix Task
Future vs. Monix Task
 
OOP Core Concept
OOP Core ConceptOOP Core Concept
OOP Core Concept
 
Java and j2ee_lab-manual
Java and j2ee_lab-manualJava and j2ee_lab-manual
Java and j2ee_lab-manual
 
Quark: A Purely-Functional Scala DSL for Data Processing & Analytics
Quark: A Purely-Functional Scala DSL for Data Processing & AnalyticsQuark: A Purely-Functional Scala DSL for Data Processing & Analytics
Quark: A Purely-Functional Scala DSL for Data Processing & Analytics
 
JAVA OOP
JAVA OOPJAVA OOP
JAVA OOP
 
First-Class Patterns
First-Class PatternsFirst-Class Patterns
First-Class Patterns
 
Scala ntnu
Scala ntnuScala ntnu
Scala ntnu
 
Collection v3
Collection v3Collection v3
Collection v3
 
[Codemotion 2015] patrones de diseño con java8
[Codemotion 2015] patrones de diseño con java8[Codemotion 2015] patrones de diseño con java8
[Codemotion 2015] patrones de diseño con java8
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Implementing the IO Monad in Scala
Implementing the IO Monad in ScalaImplementing the IO Monad in Scala
Implementing the IO Monad in Scala
 
Learn Java Part 11
Learn Java Part 11Learn Java Part 11
Learn Java Part 11
 
Scala traits training by Sanjeev Kumar @Kick Start Scala traits & Play, organ...
Scala traits training by Sanjeev Kumar @Kick Start Scala traits & Play, organ...Scala traits training by Sanjeev Kumar @Kick Start Scala traits & Play, organ...
Scala traits training by Sanjeev Kumar @Kick Start Scala traits & Play, organ...
 
Chapter i(introduction to java)
Chapter i(introduction to java)Chapter i(introduction to java)
Chapter i(introduction to java)
 
Functor, Apply, Applicative And Monad
Functor, Apply, Applicative And MonadFunctor, Apply, Applicative And Monad
Functor, Apply, Applicative And Monad
 
From Functor Composition to Monad Transformers
From Functor Composition to Monad TransformersFrom Functor Composition to Monad Transformers
From Functor Composition to Monad Transformers
 
ScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin OderskyScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin Odersky
 

Viewers also liked

Scala - A Scalable Language
Scala - A Scalable LanguageScala - A Scalable Language
Scala - A Scalable LanguageMario Gleichmann
 
Analysis and research of system security based on android
Analysis and research of system security based on androidAnalysis and research of system security based on android
Analysis and research of system security based on androidRavishankar Kumar
 
MQTT - The Internet of Things Protocol
MQTT - The Internet of Things ProtocolMQTT - The Internet of Things Protocol
MQTT - The Internet of Things ProtocolBen Hardill
 
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorialPowering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorialBenjamin Cabé
 
Introduction MQTT in English
Introduction MQTT in EnglishIntroduction MQTT in English
Introduction MQTT in EnglishEric Xiao
 
MQTT - A practical protocol for the Internet of Things
MQTT - A practical protocol for the Internet of ThingsMQTT - A practical protocol for the Internet of Things
MQTT - A practical protocol for the Internet of ThingsBryan Boyd
 
MQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingMQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingPeter R. Egli
 
Med Eye by Mint Solutions LATEST TECHNOLOGIES REPORT
Med Eye by Mint Solutions LATEST TECHNOLOGIES REPORT Med Eye by Mint Solutions LATEST TECHNOLOGIES REPORT
Med Eye by Mint Solutions LATEST TECHNOLOGIES REPORT Furqan Aslam
 
Med Eye by Mint Solutions LATEST TECHNOLOGIES
Med Eye by Mint Solutions LATEST TECHNOLOGIESMed Eye by Mint Solutions LATEST TECHNOLOGIES
Med Eye by Mint Solutions LATEST TECHNOLOGIESFurqan Aslam
 
Latest Seminar Topics for Engineering,MCA,MSc Students
Latest Seminar Topics for Engineering,MCA,MSc StudentsLatest Seminar Topics for Engineering,MCA,MSc Students
Latest Seminar Topics for Engineering,MCA,MSc StudentsArun Kumar
 
Best topics for seminar
Best topics for seminarBest topics for seminar
Best topics for seminarshilpi nagpal
 

Viewers also liked (11)

Scala - A Scalable Language
Scala - A Scalable LanguageScala - A Scalable Language
Scala - A Scalable Language
 
Analysis and research of system security based on android
Analysis and research of system security based on androidAnalysis and research of system security based on android
Analysis and research of system security based on android
 
MQTT - The Internet of Things Protocol
MQTT - The Internet of Things ProtocolMQTT - The Internet of Things Protocol
MQTT - The Internet of Things Protocol
 
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorialPowering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
 
Introduction MQTT in English
Introduction MQTT in EnglishIntroduction MQTT in English
Introduction MQTT in English
 
MQTT - A practical protocol for the Internet of Things
MQTT - A practical protocol for the Internet of ThingsMQTT - A practical protocol for the Internet of Things
MQTT - A practical protocol for the Internet of Things
 
MQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingMQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message Queueing
 
Med Eye by Mint Solutions LATEST TECHNOLOGIES REPORT
Med Eye by Mint Solutions LATEST TECHNOLOGIES REPORT Med Eye by Mint Solutions LATEST TECHNOLOGIES REPORT
Med Eye by Mint Solutions LATEST TECHNOLOGIES REPORT
 
Med Eye by Mint Solutions LATEST TECHNOLOGIES
Med Eye by Mint Solutions LATEST TECHNOLOGIESMed Eye by Mint Solutions LATEST TECHNOLOGIES
Med Eye by Mint Solutions LATEST TECHNOLOGIES
 
Latest Seminar Topics for Engineering,MCA,MSc Students
Latest Seminar Topics for Engineering,MCA,MSc StudentsLatest Seminar Topics for Engineering,MCA,MSc Students
Latest Seminar Topics for Engineering,MCA,MSc Students
 
Best topics for seminar
Best topics for seminarBest topics for seminar
Best topics for seminar
 

Similar to ACCU 2011 Introduction to Scala: An Object Functional Programming Language

Scala at GenevaJUG by Iulian Dragos
Scala at GenevaJUG by Iulian DragosScala at GenevaJUG by Iulian Dragos
Scala at GenevaJUG by Iulian DragosGenevaJUG
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojureAbbas Raza
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
Intro to scala
Intro to scalaIntro to scala
Intro to scalaJoe Zulli
 
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
 
Ten-page Brief Overview of Swift for Scala Developers
Ten-page Brief Overview of Swift for Scala DevelopersTen-page Brief Overview of Swift for Scala Developers
Ten-page Brief Overview of Swift for Scala Developersihji
 
Kotlin: forse è la volta buona (Trento)
Kotlin: forse è la volta buona (Trento)Kotlin: forse è la volta buona (Trento)
Kotlin: forse è la volta buona (Trento)Davide Cerbo
 
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 DevelopersMiles Sabin
 
T3chFest 2016 - The polyglot programmer
T3chFest 2016 - The polyglot programmerT3chFest 2016 - The polyglot programmer
T3chFest 2016 - The polyglot programmerDavid Muñoz Díaz
 
JavaCro 2014 Scala and Java EE 7 Development Experiences
JavaCro 2014 Scala and Java EE 7 Development ExperiencesJavaCro 2014 Scala and Java EE 7 Development Experiences
JavaCro 2014 Scala and Java EE 7 Development ExperiencesPeter Pilgrim
 
Design Pattern Observations
Design Pattern ObservationsDesign Pattern Observations
Design Pattern ObservationsDmitri Nesteruk
 
Introduction to Functional Programming with Scala
Introduction to Functional Programming with ScalaIntroduction to Functional Programming with Scala
Introduction to Functional Programming with Scalapramode_ce
 

Similar to ACCU 2011 Introduction to Scala: An Object Functional Programming Language (20)

Scala in Practice
Scala in PracticeScala in Practice
Scala in Practice
 
Scala at GenevaJUG by Iulian Dragos
Scala at GenevaJUG by Iulian DragosScala at GenevaJUG by Iulian Dragos
Scala at GenevaJUG by Iulian Dragos
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
Intro to scala
Intro to scalaIntro to scala
Intro to scala
 
Scala introduction
Scala introductionScala introduction
Scala introduction
 
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
 
Scala for curious
Scala for curiousScala for curious
Scala for curious
 
Ten-page Brief Overview of Swift for Scala Developers
Ten-page Brief Overview of Swift for Scala DevelopersTen-page Brief Overview of Swift for Scala Developers
Ten-page Brief Overview of Swift for Scala Developers
 
Kotlin: forse è la volta buona (Trento)
Kotlin: forse è la volta buona (Trento)Kotlin: forse è la volta buona (Trento)
Kotlin: forse è la volta buona (Trento)
 
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
 
T3chFest 2016 - The polyglot programmer
T3chFest 2016 - The polyglot programmerT3chFest 2016 - The polyglot programmer
T3chFest 2016 - The polyglot programmer
 
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter PilgrimJavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
 
JavaCro 2014 Scala and Java EE 7 Development Experiences
JavaCro 2014 Scala and Java EE 7 Development ExperiencesJavaCro 2014 Scala and Java EE 7 Development Experiences
JavaCro 2014 Scala and Java EE 7 Development Experiences
 
Design Pattern Observations
Design Pattern ObservationsDesign Pattern Observations
Design Pattern Observations
 
Introduction to Functional Programming with Scala
Introduction to Functional Programming with ScalaIntroduction to Functional Programming with Scala
Introduction to Functional Programming with Scala
 

More from Peter Pilgrim

Devoxx 2019 - Why we pair?
Devoxx 2019 - Why we pair?Devoxx 2019 - Why we pair?
Devoxx 2019 - Why we pair?Peter Pilgrim
 
Cloud native java are we there yet go tech world 2019
Cloud native java   are we there yet  go tech world 2019Cloud native java   are we there yet  go tech world 2019
Cloud native java are we there yet go tech world 2019Peter Pilgrim
 
LJC 2018 - PEAT UK - Java EE - Ah, ah, ah! Staying Alive!
LJC 2018 - PEAT UK - Java EE - Ah, ah, ah! Staying Alive!LJC 2018 - PEAT UK - Java EE - Ah, ah, ah! Staying Alive!
LJC 2018 - PEAT UK - Java EE - Ah, ah, ah! Staying Alive!Peter Pilgrim
 
CON6148 - You Are Not Cut Out To Be A Java Contractor - JavaOne 2017
CON6148 - You Are Not Cut Out To Be A Java Contractor - JavaOne 2017CON6148 - You Are Not Cut Out To Be A Java Contractor - JavaOne 2017
CON6148 - You Are Not Cut Out To Be A Java Contractor - JavaOne 2017Peter Pilgrim
 
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...Peter Pilgrim
 
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVMQCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVMPeter Pilgrim
 
Java EE & Glass Fish User Group: Digital JavaEE 7 - New and Noteworthy
Java EE & Glass Fish User Group: Digital JavaEE 7 - New and NoteworthyJava EE & Glass Fish User Group: Digital JavaEE 7 - New and Noteworthy
Java EE & Glass Fish User Group: Digital JavaEE 7 - New and NoteworthyPeter Pilgrim
 
BOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala appsBOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala appsPeter Pilgrim
 
AOTB2014: Agile Testing on the Java Platform
AOTB2014: Agile Testing on the Java PlatformAOTB2014: Agile Testing on the Java Platform
AOTB2014: Agile Testing on the Java PlatformPeter Pilgrim
 
JavaCro 2014 Digital Development with Java EE and Java Platform
JavaCro 2014 Digital Development with Java EE and Java PlatformJavaCro 2014 Digital Development with Java EE and Java Platform
JavaCro 2014 Digital Development with Java EE and Java PlatformPeter Pilgrim
 
ACCU 2013 Taking Scala into the Enterpise
ACCU 2013 Taking Scala into the EnterpiseACCU 2013 Taking Scala into the Enterpise
ACCU 2013 Taking Scala into the EnterpisePeter Pilgrim
 
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...Peter Pilgrim
 
JavaOne 2011 Progressive JavaFX 2.0 Custom Components
JavaOne 2011 Progressive JavaFX 2.0 Custom ComponentsJavaOne 2011 Progressive JavaFX 2.0 Custom Components
JavaOne 2011 Progressive JavaFX 2.0 Custom ComponentsPeter Pilgrim
 

More from Peter Pilgrim (13)

Devoxx 2019 - Why we pair?
Devoxx 2019 - Why we pair?Devoxx 2019 - Why we pair?
Devoxx 2019 - Why we pair?
 
Cloud native java are we there yet go tech world 2019
Cloud native java   are we there yet  go tech world 2019Cloud native java   are we there yet  go tech world 2019
Cloud native java are we there yet go tech world 2019
 
LJC 2018 - PEAT UK - Java EE - Ah, ah, ah! Staying Alive!
LJC 2018 - PEAT UK - Java EE - Ah, ah, ah! Staying Alive!LJC 2018 - PEAT UK - Java EE - Ah, ah, ah! Staying Alive!
LJC 2018 - PEAT UK - Java EE - Ah, ah, ah! Staying Alive!
 
CON6148 - You Are Not Cut Out To Be A Java Contractor - JavaOne 2017
CON6148 - You Are Not Cut Out To Be A Java Contractor - JavaOne 2017CON6148 - You Are Not Cut Out To Be A Java Contractor - JavaOne 2017
CON6148 - You Are Not Cut Out To Be A Java Contractor - JavaOne 2017
 
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...
 
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVMQCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
 
Java EE & Glass Fish User Group: Digital JavaEE 7 - New and Noteworthy
Java EE & Glass Fish User Group: Digital JavaEE 7 - New and NoteworthyJava EE & Glass Fish User Group: Digital JavaEE 7 - New and Noteworthy
Java EE & Glass Fish User Group: Digital JavaEE 7 - New and Noteworthy
 
BOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala appsBOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala apps
 
AOTB2014: Agile Testing on the Java Platform
AOTB2014: Agile Testing on the Java PlatformAOTB2014: Agile Testing on the Java Platform
AOTB2014: Agile Testing on the Java Platform
 
JavaCro 2014 Digital Development with Java EE and Java Platform
JavaCro 2014 Digital Development with Java EE and Java PlatformJavaCro 2014 Digital Development with Java EE and Java Platform
JavaCro 2014 Digital Development with Java EE and Java Platform
 
ACCU 2013 Taking Scala into the Enterpise
ACCU 2013 Taking Scala into the EnterpiseACCU 2013 Taking Scala into the Enterpise
ACCU 2013 Taking Scala into the Enterpise
 
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
 
JavaOne 2011 Progressive JavaFX 2.0 Custom Components
JavaOne 2011 Progressive JavaFX 2.0 Custom ComponentsJavaOne 2011 Progressive JavaFX 2.0 Custom Components
JavaOne 2011 Progressive JavaFX 2.0 Custom Components
 

Recently uploaded

Shark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsShark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsArubSultan
 
HackerOne X IoT Lab Bug Bounty 101 with Encryptsaan & IoT Lab at KIIT Univers...
HackerOne X IoT Lab Bug Bounty 101 with Encryptsaan & IoT Lab at KIIT Univers...HackerOne X IoT Lab Bug Bounty 101 with Encryptsaan & IoT Lab at KIIT Univers...
HackerOne X IoT Lab Bug Bounty 101 with Encryptsaan & IoT Lab at KIIT Univers...kumarpriyanshu81
 
The role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipThe role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipKarl Donert
 
BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...
BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...
BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...Nguyen Thanh Tu Collection
 
Objectives n learning outcoms - MD 20240404.pptx
Objectives n learning outcoms - MD 20240404.pptxObjectives n learning outcoms - MD 20240404.pptx
Objectives n learning outcoms - MD 20240404.pptxMadhavi Dharankar
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesVijayaLaxmi84
 
16. Discovery, function and commercial uses of different PGRS.pptx
16. Discovery, function and commercial uses of different PGRS.pptx16. Discovery, function and commercial uses of different PGRS.pptx
16. Discovery, function and commercial uses of different PGRS.pptxUmeshTimilsina1
 
How to Share Dashboard in the Odoo 17 ERP
How to Share Dashboard in the Odoo 17 ERPHow to Share Dashboard in the Odoo 17 ERP
How to Share Dashboard in the Odoo 17 ERPCeline George
 
LEVERAGING SYNERGISM INDUSTRY-ACADEMIA PARTNERSHIP FOR IMPLEMENTATION OF NAT...
LEVERAGING SYNERGISM INDUSTRY-ACADEMIA PARTNERSHIP FOR IMPLEMENTATION OF  NAT...LEVERAGING SYNERGISM INDUSTRY-ACADEMIA PARTNERSHIP FOR IMPLEMENTATION OF  NAT...
LEVERAGING SYNERGISM INDUSTRY-ACADEMIA PARTNERSHIP FOR IMPLEMENTATION OF NAT...pragatimahajan3
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Views in Odoo 17 - Kanban View in odoo 17
Views in Odoo 17 - Kanban View  in odoo 17Views in Odoo 17 - Kanban View  in odoo 17
Views in Odoo 17 - Kanban View in odoo 17Celine George
 
Farrington HS Streamlines Guest Entrance
Farrington HS Streamlines Guest EntranceFarrington HS Streamlines Guest Entrance
Farrington HS Streamlines Guest Entrancejulius27264
 
4.4.24 Economic Precarity and Global Economic Forces.pptx
4.4.24 Economic Precarity and Global Economic Forces.pptx4.4.24 Economic Precarity and Global Economic Forces.pptx
4.4.24 Economic Precarity and Global Economic Forces.pptxmary850239
 
What is Property Fields in Odoo 17 ERP Module
What is Property Fields in Odoo 17 ERP ModuleWhat is Property Fields in Odoo 17 ERP Module
What is Property Fields in Odoo 17 ERP ModuleCeline George
 
How to create _name_search function in odoo 17
How to create _name_search function in odoo 17How to create _name_search function in odoo 17
How to create _name_search function in odoo 17Celine George
 
4.9.24 Social Capital and Social Exclusion.pptx
4.9.24 Social Capital and Social Exclusion.pptx4.9.24 Social Capital and Social Exclusion.pptx
4.9.24 Social Capital and Social Exclusion.pptxmary850239
 
Executive Directors Chat Initiating Equity for Impact.pdf
Executive Directors Chat  Initiating Equity for Impact.pdfExecutive Directors Chat  Initiating Equity for Impact.pdf
Executive Directors Chat Initiating Equity for Impact.pdfTechSoup
 
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEPART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEMISSRITIMABIOLOGYEXP
 
Supply agency market - aiming high 2.pdf
Supply agency market - aiming high 2.pdfSupply agency market - aiming high 2.pdf
Supply agency market - aiming high 2.pdftomeskell101
 

Recently uploaded (20)

Shark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsShark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristics
 
HackerOne X IoT Lab Bug Bounty 101 with Encryptsaan & IoT Lab at KIIT Univers...
HackerOne X IoT Lab Bug Bounty 101 with Encryptsaan & IoT Lab at KIIT Univers...HackerOne X IoT Lab Bug Bounty 101 with Encryptsaan & IoT Lab at KIIT Univers...
HackerOne X IoT Lab Bug Bounty 101 with Encryptsaan & IoT Lab at KIIT Univers...
 
The role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipThe role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenship
 
CARNAVAL COM MAGIA E EUFORIA _
CARNAVAL COM MAGIA E EUFORIA            _CARNAVAL COM MAGIA E EUFORIA            _
CARNAVAL COM MAGIA E EUFORIA _
 
BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...
BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...
BÀI TẬP BỔ TRỢ 4 KĨ NĂNG TIẾNG ANH LỚP 8 - CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC ...
 
Objectives n learning outcoms - MD 20240404.pptx
Objectives n learning outcoms - MD 20240404.pptxObjectives n learning outcoms - MD 20240404.pptx
Objectives n learning outcoms - MD 20240404.pptx
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their uses
 
16. Discovery, function and commercial uses of different PGRS.pptx
16. Discovery, function and commercial uses of different PGRS.pptx16. Discovery, function and commercial uses of different PGRS.pptx
16. Discovery, function and commercial uses of different PGRS.pptx
 
How to Share Dashboard in the Odoo 17 ERP
How to Share Dashboard in the Odoo 17 ERPHow to Share Dashboard in the Odoo 17 ERP
How to Share Dashboard in the Odoo 17 ERP
 
LEVERAGING SYNERGISM INDUSTRY-ACADEMIA PARTNERSHIP FOR IMPLEMENTATION OF NAT...
LEVERAGING SYNERGISM INDUSTRY-ACADEMIA PARTNERSHIP FOR IMPLEMENTATION OF  NAT...LEVERAGING SYNERGISM INDUSTRY-ACADEMIA PARTNERSHIP FOR IMPLEMENTATION OF  NAT...
LEVERAGING SYNERGISM INDUSTRY-ACADEMIA PARTNERSHIP FOR IMPLEMENTATION OF NAT...
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Views in Odoo 17 - Kanban View in odoo 17
Views in Odoo 17 - Kanban View  in odoo 17Views in Odoo 17 - Kanban View  in odoo 17
Views in Odoo 17 - Kanban View in odoo 17
 
Farrington HS Streamlines Guest Entrance
Farrington HS Streamlines Guest EntranceFarrington HS Streamlines Guest Entrance
Farrington HS Streamlines Guest Entrance
 
4.4.24 Economic Precarity and Global Economic Forces.pptx
4.4.24 Economic Precarity and Global Economic Forces.pptx4.4.24 Economic Precarity and Global Economic Forces.pptx
4.4.24 Economic Precarity and Global Economic Forces.pptx
 
What is Property Fields in Odoo 17 ERP Module
What is Property Fields in Odoo 17 ERP ModuleWhat is Property Fields in Odoo 17 ERP Module
What is Property Fields in Odoo 17 ERP Module
 
How to create _name_search function in odoo 17
How to create _name_search function in odoo 17How to create _name_search function in odoo 17
How to create _name_search function in odoo 17
 
4.9.24 Social Capital and Social Exclusion.pptx
4.9.24 Social Capital and Social Exclusion.pptx4.9.24 Social Capital and Social Exclusion.pptx
4.9.24 Social Capital and Social Exclusion.pptx
 
Executive Directors Chat Initiating Equity for Impact.pdf
Executive Directors Chat  Initiating Equity for Impact.pdfExecutive Directors Chat  Initiating Equity for Impact.pdf
Executive Directors Chat Initiating Equity for Impact.pdf
 
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEPART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
 
Supply agency market - aiming high 2.pdf
Supply agency market - aiming high 2.pdfSupply agency market - aiming high 2.pdf
Supply agency market - aiming high 2.pdf
 

ACCU 2011 Introduction to Scala: An Object Functional Programming Language