SPRECHEN SIE SCALA?
 Heiko Seeberger, WeigleWilczek
 rheinjug Düsseldorf, 18.03.2010
WARUM SCALA?
WARUM SCALA?


Which Programming Language would you use
 now on top of JVM, except Java? - Scala.
                        ...
WARUM SCALA?


Scala, it must be stated, is the current
  heir apparent to the Java throne.
                              ...
WARUM SCALA?


I can honestly say if someone had shown me ... Scala ...
 back in 2003 I'd probably have never created Groo...
obje
          eift                  kt-fu                                   pis iert
a   us ger                          ...
Seit 2003




                         Version 2.8


            AUSGEREIFT
OBJEKT-FUNKTIONAL
Any



       AnyVal                                         AnyRef



Int                Unit                 ScalaObject...
Keine Seiteneffekte


         1, 2, 3         f        a, b, c




                      Funktionen höherer Ordnung


   ...
STATISCH TYPISIERT
Semicolon Inference           Type Inference




Infix Operator Notation   Implicit Conversions


             LEICHTGEWICH...
AUSDRUCKSSTARK

"Calling Person.toString" when {
  "first and last name are not-empty" should {
    "return first name bla...
KNAPP UND PRÄZISE
public class Person {                          // Java

    private final String firstName;
    private ...
PRAGMATISCH
INTEROPERABEL MIT JAVA

scala> import org.apache.log4j._
import org.apache.log4j._

scala> val testLogger = Logger getLogg...
LIVE DEMO: HELLO WORLD
Klas
                         sen-
  as sen                     Para                         thoden
Kl                    ...
rkz eug
        st- We
      Te




LIVE DEMO: SCALATEST

      DSL
         -Bei
                 spie
                  ...
Für
             Libr
                 ary-E
                      ntw
                         icklu
                    ...
Unv
Type                                      erän
       Infe                ato ren        Obje
                        ...
Meh
   rfac
       hver
           erbu
               ng r
                      icht
                             ig ge
...
Upp                                          ma cht   Low
    er B                               i g ge             er Bo
...
Swit
                tern          ch   rich                                    tern
             Pat                     ...
pra che
                    er S
                in d
     L ite rale




LIVE DEMO: XML-SUPPORT

        XPa
            ...
FRAGEN / DISKUSSION
DANKE


seeberger@weiglewilczek.com

     XING Scala-Gruppe
Upcoming SlideShare
Loading in...5
×

RheinJUG 2010 - Sprechen Sie Scala?

635

Published on

Einführung in Scala mit vielen Live-Demos.

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

  • Be the first to like this

No Downloads
Views
Total Views
635
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

RheinJUG 2010 - Sprechen Sie Scala?

  1. 1. SPRECHEN SIE SCALA? Heiko Seeberger, WeigleWilczek rheinjug Düsseldorf, 18.03.2010
  2. 2. WARUM SCALA?
  3. 3. WARUM SCALA? Which Programming Language would you use now on top of JVM, except Java? - Scala. James Gosling
  4. 4. WARUM SCALA? Scala, it must be stated, is the current heir apparent to the Java throne. Charles Nutter
  5. 5. WARUM SCALA? I can honestly say if someone had shown me ... Scala ... back in 2003 I'd probably have never created Groovy. James Strachan
  6. 6. obje eift kt-fu pis iert a us ger nkti ona tisc h ty l sta leich ark tgew sst icht ig WAS IST SCALA? au sdr uck knap inte rope p un d pr ati sch rabe äzis e p ragm l mit Java
  7. 7. Seit 2003 Version 2.8 AUSGEREIFT
  8. 8. OBJEKT-FUNKTIONAL
  9. 9. Any AnyVal AnyRef Int Unit ScalaObject Long scala.* val scala.* ref java.* ref Null Nothing ALLES IST EIN OBJEKT
  10. 10. Keine Seiteneffekte 1, 2, 3 f a, b, c Funktionen höherer Ordnung FUNKTIONALE PROGRAMMIERUNG
  11. 11. STATISCH TYPISIERT
  12. 12. Semicolon Inference Type Inference Infix Operator Notation Implicit Conversions LEICHTGEWICHTIG
  13. 13. AUSDRUCKSSTARK "Calling Person.toString" when { "first and last name are not-empty" should { "return first name blank last name" in { val person = new Person("John", "Doe") person.toString should be ("John Doe") } } }
  14. 14. KNAPP UND PRÄZISE public class Person { // Java private final String firstName; private final String lastName; public class Person(val firstName: String, Person(String firstName, String lastName) { val lastName: String) this.firstName = firstName; this.lastName = lastName; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } }
  15. 15. PRAGMATISCH
  16. 16. INTEROPERABEL MIT JAVA scala> import org.apache.log4j._ import org.apache.log4j._ scala> val testLogger = Logger getLogger "test" testLogger: org.apache.log4j.Logger = ... Wichtig!
  17. 17. LIVE DEMO: HELLO WORLD
  18. 18. Klas sen- as sen Para thoden Kl m eter M e LIVE DEMO: OO-GRUNDLAGEN Defa Com ult-Ar pan gum Fe lder ion Obje ente cts
  19. 19. rkz eug st- We Te LIVE DEMO: SCALATEST DSL -Bei spie l
  20. 20. Für Libr ary-E ntw icklu ng LIVE DEMO: IMPLICIT CONVERSIONS pra che rbare S Skalie
  21. 21. Unv Type erän Infe ato ren Obje derl iche renc e O per kte LIVE DEMO: FUNKTIONALE LISTE nen g Funk ktio nun Fun Ord tion slite tio nen rer rale Funk h öhe
  22. 22. Meh rfac hver erbu ng r icht ig ge mac ht LIVE DEMO: TRAITS ns c atio M odifi ackabe St
  23. 23. Upp ma cht Low er B i g ge er Bo ound i cht und s eri cs r s Gen LIVE DEMO: TYP-PARAMETER i anz Kov aria ari anz In var nz trav Kon
  24. 24. Swit tern ch rich tern Pat tig g Pat d card ema nst ant Wil c ht Co LIVE DEMO: PATTERN MATCHING Vari ern Seq able att u ence Patt t or P Patt e rn st ruc ern Con
  25. 25. pra che er S in d L ite rale LIVE DEMO: XML-SUPPORT XPa th-A bfra gen
  26. 26. FRAGEN / DISKUSSION
  27. 27. DANKE seeberger@weiglewilczek.com XING Scala-Gruppe
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×