SlideShare a Scribd company logo
1 of 217
Basic Wicket
                              and Scala



                                Daan van Etten
                                http://stuq.nl

                                Amsterdam, March 24, 2009

Wednesday, March 25, 2009
Hi!


Wednesday, March 25, 2009
Goal:
         After this talk, you
          can start coding
          Wicket in Scala.
Wednesday, March 25, 2009
Overview


Wednesday, March 25, 2009
Scala
Wednesday, March 25, 2009
What is

                            Scala ?
Wednesday, March 25, 2009
Hello, World!


Wednesday, March 25, 2009
Functional
                             concepts

Wednesday, March 25, 2009
+
Wednesday, March 25, 2009
?
Wednesday, March 25, 2009
Simple project


Wednesday, March 25, 2009
maven

Wednesday, March 25, 2009
Java Scala

Wednesday, March 25, 2009
Wednesday, March 25, 2009
Who am I?


Wednesday, March 25, 2009
Wednesday, March 25, 2009
Daan van Etten




Wednesday, March 25, 2009
Daan van Etten




                                        gineer
                                  are En
                               tw
                            Sof




Wednesday, March 25, 2009
Daan van Etten
                                            eer
                                        ngin
                               ftware E
                            So




Wednesday, March 25, 2009
Daan van Etten
                                            er
                                   e Engine
                            Softwar

                                                 @work




Wednesday, March 25, 2009
Daan van Etten
                                            er
                                   e Engine
                            Softwar




Wednesday, March 25, 2009
Daan van Etten
                                            er
                                   e Engine
                            Softwar




Wednesday, March 25, 2009
Let’s begin


Wednesday, March 25, 2009
What is

                            Scala ?
Wednesday, March 25, 2009
Scala




Wednesday, March 25, 2009
Scala

                            History


Wednesday, March 25, 2009
Scala


                            1958
Wednesday, March 25, 2009
Scala

              Martin Odersky


Wednesday, March 25, 2009
Scala




Wednesday, March 25, 2009
Scala

                            Compilers


Wednesday, March 25, 2009
Scala

                            Functional
                            languages

Wednesday, March 25, 2009
Scala

                            Functional
                            languages
                            (more about that later)

Wednesday, March 25, 2009
Scala




Wednesday, March 25, 2009
Scala

                            Generic
                             Java

Wednesday, March 25, 2009
Scala




Wednesday, March 25, 2009
Scala

                             Java 5
                            Generics

Wednesday, March 25, 2009
Scala

                            New javac


Wednesday, March 25, 2009
Scala


                            2001
Wednesday, March 25, 2009
Scala

                            Scala


Wednesday, March 25, 2009
Scala

                            First release


Wednesday, March 25, 2009
Scala


                            2003
Wednesday, March 25, 2009
Scala

            Object Oriented


Wednesday, March 25, 2009
Scala

                            Functional


Wednesday, March 25, 2009
Scala

                            Statically typed




Wednesday, March 25, 2009
Scala

                            Type inference




Wednesday, March 25, 2009
Scala

                            Type inference

                    var foo = 8



Wednesday, March 25, 2009
Scala

                            Type inference

                    var foo = 8
                    foo = “bar”

Wednesday, March 25, 2009
Scala

                            Type inference
                                    type mismatch;
                    var foo = 8     found: String(quot;barquot;)
                    foo = “bar”     required: Int



Wednesday, March 25, 2009
Scala

                  Every value is an object




Wednesday, March 25, 2009
Scala

                  Every value is an object

                            var foo = 8



Wednesday, March 25, 2009
Scala

                  Every value is an object

                         var foo = 8
                def bar(a: String)= println(a)

Wednesday, March 25, 2009
Scala

                            Every operation is a
                               method call



Wednesday, March 25, 2009
Scala

                            Every operation is a
                               method call

                                1+3-6

Wednesday, March 25, 2009
Scala

                            Every operation is a
                               method call

                               1+3-6
                               1.+(3).-(6)
Wednesday, March 25, 2009
Scala

                     Compiles to
                    Java bytecode

Wednesday, March 25, 2009
Scala

                            Runs on the
                             Java VM

Wednesday, March 25, 2009
Scala

                            Scalable
              From small scripts to large systems


Wednesday, March 25, 2009
Scala

                            Hello, World!


Wednesday, March 25, 2009
Scala
         object HelloWorld {
           def main(args: Array[String]) {
             println(quot;Hello, world!quot;)
           }
         }



Wednesday, March 25, 2009
Scala


                            20 seconds

Wednesday, March 25, 2009
Scala




Wednesday, March 25, 2009
Scala




Wednesday, March 25, 2009
Scala




Wednesday, March 25, 2009
Scala




Wednesday, March 25, 2009
Scala

                            Functional
                             concepts

Wednesday, March 25, 2009
Scala




Wednesday, March 25, 2009
Scala
                            Design goals:

                            Embrace immutability
                            Avoid state


Wednesday, March 25, 2009
Scala

                            Cleaner code




Wednesday, March 25, 2009
Scala

                               Cleaner code
                            More ne-grained reuse


Wednesday, March 25, 2009
Scala

                            Cleaner code
                       More ne-grained reuse
                      No Iterator loops needed :-)

Wednesday, March 25, 2009
Scala

                            Better optimizations




Wednesday, March 25, 2009
Scala

                            Better optimizations
                                 Multi-core!



Wednesday, March 25, 2009
Scala

                            Better optimizations
                                 Multi-core!
                               Lazy evaluation


Wednesday, March 25, 2009
Scala

                            Better optimizations
                                 Multi-core!
                               Lazy evaluation
                                  Recursion

Wednesday, March 25, 2009
Scala

                             What about
                            the functions?



Wednesday, March 25, 2009
Scala

                            Every operation is a
                               method call



Wednesday, March 25, 2009
Scala

                            Every operation is a
                               method call

                                1+3-6

Wednesday, March 25, 2009
Scala

                            Every operation is a
                               method call

                               1+3-6
                               1.+(3).-(6)
Wednesday, March 25, 2009
Scala
                            Function nesting




Wednesday, March 25, 2009
Scala
                            Function nesting
         def function1(x : Int) = {




Wednesday, March 25, 2009
Scala
                            Function nesting
         def function1(x : Int) = {
           def function2() = {




Wednesday, March 25, 2009
Scala
                            Function nesting
         def function1(x : Int) = {
           def function2() = {
              println(x)



Wednesday, March 25, 2009
Scala
                            Function nesting
         def function1(x : Int) = {
           def function2() = {
              println(x)
           }


Wednesday, March 25, 2009
Scala
                            Function nesting
         def function1(x : Int) = {
           def function2() = {
              println(x)
           }
           function2()

Wednesday, March 25, 2009
Scala
                            Function nesting
         def function1(x : Int) = {
           def function2() = {
              println(x)
           }
           function2()
         }
Wednesday, March 25, 2009
Scala
                            First-class functions




Wednesday, March 25, 2009
Scala
                            First-class functions
         def foo (cb: ()=>Unit): Unit = {




Wednesday, March 25, 2009
Scala
                            First-class functions
         def foo (cb: ()=>Unit): Unit = {
           while (true) {




Wednesday, March 25, 2009
Scala
                            First-class functions
         def foo (cb: ()=>Unit): Unit = {
           while (true) {
            cb(); Thread.sleep(1000);




Wednesday, March 25, 2009
Scala
                            First-class functions
         def foo (cb: ()=>Unit): Unit = {
           while (true) {
             cb(); Thread.sleep(1000);
           }



Wednesday, March 25, 2009
Scala
                            First-class functions
         def foo (cb: ()=>Unit): Unit = {
           while (true) {
             cb(); Thread.sleep(1000);
           }
         }


Wednesday, March 25, 2009
Scala
                            First-class functions
         def foo (cb: ()=>Unit): Unit = {
           while (true) {
             cb(); Thread.sleep(1000);
           }
         }

         foo(Unit : println(quot;hiquot;))
Wednesday, March 25, 2009
Scala
                     First-class functions in
                             libraries




Wednesday, March 25, 2009
Scala
                     First-class functions in
                             libraries
         val numbers = List(2,5,8,9)




Wednesday, March 25, 2009
Scala
                     First-class functions in
                             libraries
         val numbers = List(2,5,8,9)
         numbers.foreach(



Wednesday, March 25, 2009
Scala
                     First-class functions in
                             libraries
         val numbers = List(2,5,8,9)
         numbers.foreach(
             (x: Int) => print(x)

Wednesday, March 25, 2009
Scala
                     First-class functions in
                             libraries
         val numbers = List(2,5,8,9)
         numbers.foreach(
             (x: Int) => print(x)
           )
Wednesday, March 25, 2009
Scala

                      Anonymous functions




Wednesday, March 25, 2009
Scala

                      Anonymous functions
         ((i:Int, j:Int) => i + j)(3, 4)




Wednesday, March 25, 2009
Scala

                      Anonymous functions
         ((i:Int, j:Int) => i + j)(3, 4)
         Java:
         int calc(int i, int j){ return i + j; };
         calc(3, 4);
Wednesday, March 25, 2009
Scala

          Partially applied functions




Wednesday, March 25, 2009
Scala

          Partially applied functions
         def calc(x:Int, y:Int, z:Int)=x+y+z




Wednesday, March 25, 2009
Scala

          Partially applied functions
         def calc(x:Int, y:Int, z:Int)=x+y+z

         val calcPart = calc(1, _:Int, 3)


Wednesday, March 25, 2009
Scala

          Partially applied functions
         def calc(x:Int, y:Int, z:Int)=x+y+z

         val calcPart = calc(1, _:Int, 3)

         calcPart(4)
Wednesday, March 25, 2009
+
Wednesday, March 25, 2009
+




Wednesday, March 25, 2009
+



                  Simple project


Wednesday, March 25, 2009
+



                            Hello, Wicket
                               World!
Wednesday, March 25, 2009
+
   object HelloWorld {
     def main(args: Array[String]) {
       println(quot;Hello, world!quot;)
     }
   }




Wednesday, March 25, 2009
+
   class HelloWorld extends WebApplication {
     def main(args: Array[String]) {
        println(quot;Hello, world!quot;)
     }
   }




Wednesday, March 25, 2009
+
   class HelloWorld extends WebApplication {

   }




Wednesday, March 25, 2009
+
   class HelloWorld extends WebApplication {
     def getHomePage = classOf[HomePage]
   }




Wednesday, March 25, 2009
+
   class HelloWorld extends WebApplication {
     def getHomePage = classOf[HomePage]
   }
   class HomePage extends WebPage {




   }
Wednesday, March 25, 2009
+
   class HelloWorld extends WebApplication {
     def getHomePage = classOf[HomePage]
   }
   class HomePage extends WebPage {




   }
Wednesday, March 25, 2009
+
   class HelloWorld extends WebApplication {
     def getHomePage = classOf[HomePage]
   }
   class HomePage extends WebPage {
     var name = quot;quot;




   }
Wednesday, March 25, 2009
+
   class HelloWorld extends WebApplication {
     def getHomePage = classOf[HomePage]
   }
   class HomePage extends WebPage {
     var name = quot;quot;
     val form = new Form(quot;formquot;)




   }
Wednesday, March 25, 2009
+
   class HelloWorld extends WebApplication {
     def getHomePage = classOf[HomePage]
   }
   class HomePage extends WebPage {
     var name = quot;quot;
     val form = new Form(quot;formquot;)
     add(form)




   }
Wednesday, March 25, 2009
+
   class HelloWorld extends WebApplication {
     def getHomePage = classOf[HomePage]
   }
   class HomePage extends WebPage {
     var name = quot;quot;
     val form = new Form(quot;formquot;)
     add(form)
     form.add(new TextField(quot;namequot;,



   }
Wednesday, March 25, 2009
+
   class HelloWorld extends WebApplication {
     def getHomePage = classOf[HomePage]
   }
   class HomePage extends WebPage {
     var name = quot;quot;
     val form = new Form(quot;formquot;)
     add(form)
     form.add(new TextField(quot;namequot;,
       new PropertyModel(this, quot;namequot;)))


   }
Wednesday, March 25, 2009
+
   class HelloWorld extends WebApplication {
     def getHomePage = classOf[HomePage]
   }
   class HomePage extends WebPage {
     var name = quot;quot;
     val form = new Form(quot;formquot;)
     add(form)
     form.add(new TextField(quot;namequot;,
       new PropertyModel(this, quot;namequot;)))
     form.add(new Label(quot;helloworldquot;,

   }
Wednesday, March 25, 2009
+
   class HelloWorld extends WebApplication {
     def getHomePage = classOf[HomePage]
   }
   class HomePage extends WebPage {
     var name = quot;quot;
     val form = new Form(quot;formquot;)
     add(form)
     form.add(new TextField(quot;namequot;,
       new PropertyModel(this, quot;namequot;)))
     form.add(new Label(quot;helloworldquot;,
       new PropertyModel(this, quot;namequot;)))
   }
Wednesday, March 25, 2009
+
   <body>
    <p><b>Hello, Wicket World!</b></p>
    <form wicket:id=quot;formquot;>
     What's your name? <br/>
     <input wicket:id=quot;namequot;/>
     <input type=quot;submitquot; value = quot;OKquot; />

     <p>Your name is:
      <b><span wicket:id=quot;helloworldquot;/></b>
     </p>
     </form>
   </body>
Wednesday, March 25, 2009
+




Wednesday, March 25, 2009
+




Wednesday, March 25, 2009
?
Wednesday, March 25, 2009
+




Wednesday, March 25, 2009
Wednesday, March 25, 2009
EASY
              REUSABLE
          NON-INTRUSIVE
                    SAFE
               EFFICIENT
               SCALABLE
Wednesday, March 25, 2009
EASY


Wednesday, March 25, 2009
EASY
                            POJO-centric


Wednesday, March 25, 2009
EASY
                            POJO-centric


Wednesday, March 25, 2009
EASY
                            All code in Java


Wednesday, March 25, 2009
EASY
                            All code in Java
                                 or Scala

Wednesday, March 25, 2009
EASY
                        Maximum type safety and
                         compile-time problem
                              diagnosis
Wednesday, March 25, 2009
EASY
                        Maximum type safety and
                         compile-time problem
                              diagnosis
Wednesday, March 25, 2009
EASY
                            Minimum reliance on
                                special tools

Wednesday, March 25, 2009
EASY
                            Minimum reliance on
                                special tools

Wednesday, March 25, 2009
EASY


Wednesday, March 25, 2009
REUSABLE


Wednesday, March 25, 2009
REUSABLE
                             Function reuse


Wednesday, March 25, 2009
REUSABLE


Wednesday, March 25, 2009
NON-INTRUSIVE


Wednesday, March 25, 2009
NON-INTRUSIVE
                             HTML or other markup
                               not polluted with
                            programming semantics
Wednesday, March 25, 2009
NON-INTRUSIVE
                             HTML or other markup
                               not polluted with
                            programming semantics
Wednesday, March 25, 2009
NON-INTRUSIVE
                            But... Scala != Java


Wednesday, March 25, 2009
NON-INTRUSIVE
                            ?
Wednesday, March 25, 2009
SAFE


Wednesday, March 25, 2009
SAFE
                            Code is secure by default


Wednesday, March 25, 2009
SAFE
                            Code is secure by default


Wednesday, March 25, 2009
SAFE
                       All logic in Java (or Scala)
                       with maximum type safety

Wednesday, March 25, 2009
SAFE
                       All logic in Java (or Scala)
                       with maximum type safety

Wednesday, March 25, 2009
SAFE


Wednesday, March 25, 2009
EFFICIENT /
                            SCALABLE

Wednesday, March 25, 2009
EFFICIENT /
                             SCALABLE
                            Efficient and lightweight


Wednesday, March 25, 2009
EFFICIENT /
                             SCALABLE
                            Efficient and lightweight


Wednesday, March 25, 2009
EFFICIENT /
                            SCALABLE
                            Scala means reducing
                             the amount of code.

Wednesday, March 25, 2009
EFFICIENT /
                            SCALABLE
                            Scala means reducing
                             the amount of code.

Wednesday, March 25, 2009
EFFICIENT /
                            SCALABLE

Wednesday, March 25, 2009
Wednesday, March 25, 2009
EASY
              REUSABLE
          NON-INTRUSIVE
                    SAFE
               EFFICIENT
               SCALABLE
Wednesday, March 25, 2009
Wednesday, March 25, 2009
Wednesday, March 25, 2009
maven

Wednesday, March 25, 2009
maven




Wednesday, March 25, 2009
maven

                        maven-scala-plugin



Wednesday, March 25, 2009
maven
   Under <build> <plugins>
   <plugin>
     <groupId>org.scala-tools</groupId>
     <artifactId>maven-scala-plugin</artifactId>
     <executions>
       <execution>
         <goals>
           <goal>compile</goal>
           <goal>testCompile</goal>
         </goals>
       </execution>
     </executions>
Wednesday, March 25, 2009
maven
   Under <pluginRepositories>

   <pluginRepository>
    <id>scala</id>
    <name>Scala Tools</name>
    <url>http://scala-tools.org/repo-releases</url>
    <releases>
     <enabled>true</enabled>
    </releases>
    <snapshots>
     <enabled>false</enabled>
    </snapshots>
   </pluginRepository>
Wednesday, March 25, 2009
maven
   Under <repositories>

   <repository>
    <id>scala</id>
    <name>Scala Tools</name>
    <url>http://scala-tools.org/repo-releases</url>
    <releases>
     <enabled>true</enabled>
    </releases>
    <snapshots>
     <enabled>false</enabled>
    </snapshots>
   </repository>
Wednesday, March 25, 2009
maven
   Under <dependencies>

   <dependency>
     <groupId>org.scala-lang</groupId>
     <artifactId>scala-library</artifactId>
     <version>2.7.3</version>
   </dependency>




Wednesday, March 25, 2009
maven

                            You can add this to any
                             Java+Maven project!



Wednesday, March 25, 2009
maven

                            Project layout




Wednesday, March 25, 2009
maven
                            pom.xml
                            src
                                main
                                    java
                                test
                                    java




Wednesday, March 25, 2009
maven
                            pom.xml
                            src
                                main
                                    scala
                                test
                                    scala




Wednesday, March 25, 2009
maven
                            pom.xml
                            src
                                main
                                     java
                                    scala
                                test
                                     java
                                    scala

Wednesday, March 25, 2009
maven

                            Hello, Wicket World!
                              built in Maven



Wednesday, March 25, 2009
maven




Wednesday, March 25, 2009
maven




Wednesday, March 25, 2009
Download the
                            demo project.




Wednesday, March 25, 2009
Java Scala

Wednesday, March 25, 2009
Java Scala




Wednesday, March 25, 2009
Java Scala


                               Java interface
                            implemented in Scala



Wednesday, March 25, 2009
Java Scala

   public interface SomeInterface {
     void doSomething(String argument);
   }




Wednesday, March 25, 2009
Java Scala

   public interface SomeInterface {
     void doSomething(String argument);
   }

   class SomeImplementation extends SomeInterface {
      def doSomething(argument: String):Unit = {
        println(argument)
      }
   }


Wednesday, March 25, 2009
Java Scala

   public interface SomeInterface {

                                          ?
     void doSomething(String argument);
   }

   class SomeImplementation extends SomeInterface {
      def doSomething(argument: String):unit = {
        println(argument)
      }
   }


Wednesday, March 25, 2009
Java Scala



            Scala does not have interfaces!




Wednesday, March 25, 2009
Java Scala



                            Scala has traits




Wednesday, March 25, 2009
Java Scala
                                extending a trait




   class SomeImplementation extends SomeInterface {
      def doSomething(argument: String) : unit = {
        println(argument)
      }
   }


Wednesday, March 25, 2009
Java Scala



                            interface != trait



Wednesday, March 25, 2009
Java Scala


                             traits can have
                                 method
                            implementations


Wednesday, March 25, 2009
Java Scala

   public interface SomeInterface {
     void doSomething(String argument);
   }

   trait SomeTrait {
     def doSomething=(argument:String):Unit
   }




Wednesday, March 25, 2009
Java Scala

   public interface SomeInterface {
     void doSomething(String argument);
   }

   trait SomeTrait {
     def doSomething(argument:String):Unit
    
     def computeSomething = title.length * 10
   }


Wednesday, March 25, 2009
Java Scala

   public interface SomeInterface {
     void doSomething(String argument);
   }

   class SomeImplementation extends SomeInterface {
      def doSomething(argument: String):Unit = {
        println(argument)
      }
   }


Wednesday, March 25, 2009
Java Scala

   public interface SomeInterface {
     void doSomething(String argument);
   }

   class SomeImplementation extends SomeInterface {



   }


Wednesday, March 25, 2009
Java Scala


   Error: class SomeImplementation needs to be abstract
   since method doSomething in trait SomeInterface of
   type (java.lang.String)Unit is not defined.




Wednesday, March 25, 2009
Java Scala


                       Java and Scala combined:
                         Circular dependencies



Wednesday, March 25, 2009
Java Scala




Wednesday, March 25, 2009
Java Scala

   public interface SomeInterface {
     void doSomething(String argument);
   }




Wednesday, March 25, 2009
Java Scala

   public interface SomeInterface {
     void doSomething(String argument);
   }

   class SomeImplementation extends SomeInterface {
     def doSomething=(argument:String):Unit {...}
   }




Wednesday, March 25, 2009
Java Scala

   public interface SomeInterface {
     void doSomething(String argument);
   }

   class SomeImplementation extends SomeInterface {
     def doSomething=(argument:String):Unit {...}
   }

   public class Other extends SomeImplementation {
     ...
   }
Wednesday, March 25, 2009
Java Scala


                      maven-scala-plugin



Wednesday, March 25, 2009
Java Scala


                      maven-scala-plugin

                            Handles circular
                            dependencies!

Wednesday, March 25, 2009
Java Scala



                            How?



Wednesday, March 25, 2009
Java Scala




Wednesday, March 25, 2009
Java Scala

                               scalac
                            parses Java code
                                 (since 2.7.2)




Wednesday, March 25, 2009
Java Scala

   public interface SomeInterface {
     void doSomething(String argument);
   }

   class SomeImplementation extends SomeInterface {
     def doSomething=(argument:String):Unit {...}
   }

   public class Other extends SomeImplementation {
     ...
   }
Wednesday, March 25, 2009
Wednesday, March 25, 2009
Wednesday, March 25, 2009
Wednesday, March 25, 2009
Scala home on the web.

                            Reference manuals, tutorials,
                                news, speci cations.

                                                http://www.scala-lang.org
Wednesday, March 25, 2009
Interpreter, variables, methods, loops,
               arrays, lists, tuples, sets, maps, classes,
                      singletons, traits, mixins.


                            http://www.artima.com/scalazine/articles/steps.html
Wednesday, March 25, 2009
Multiple articles covering a
                            feature by feature comparison
                                   of Scala and Java


        http://blogs.sun.com/sundararajan/entry/scala_for_java_programmers
Wednesday, March 25, 2009
Series of 6 great articles
                              covering a lot of Scala.

                            Aimed at Java developers.

 http://www.codecommit.com/blog/scala/roundup-scala-for-java-refugees
Wednesday, March 25, 2009
Scala Wiki.

                   FAQ, code samples, design patterns,
                           Scala job openings

                                             http://scala.sygneca.com/
Wednesday, March 25, 2009
Official mailing lists

                            Subscribe: empty message to
                            scala-subscribe@listes.ep .ch

                                          http://www.scala-lang.org/node/199
Wednesday, March 25, 2009
All samples can be
                            downloaded at


                    http://stuq.nl

Wednesday, March 25, 2009
Get started with
             Scala and Wicket!

Wednesday, March 25, 2009
Thanks!


Wednesday, March 25, 2009

More Related Content

Recently uploaded

Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimizationarrow10202532yuvraj
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Alexander Turgeon
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5DianaGray10
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 

Recently uploaded (20)

Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

Basic Wicket and Scala

  • 1. Basic Wicket and Scala Daan van Etten http://stuq.nl Amsterdam, March 24, 2009 Wednesday, March 25, 2009
  • 3. Goal: After this talk, you can start coding Wicket in Scala. Wednesday, March 25, 2009
  • 6. What is Scala ? Wednesday, March 25, 2009
  • 8. Functional concepts Wednesday, March 25, 2009
  • 15. Who am I? Wednesday, March 25, 2009
  • 17. Daan van Etten Wednesday, March 25, 2009
  • 18. Daan van Etten gineer are En tw Sof Wednesday, March 25, 2009
  • 19. Daan van Etten eer ngin ftware E So Wednesday, March 25, 2009
  • 20. Daan van Etten er e Engine Softwar @work Wednesday, March 25, 2009
  • 21. Daan van Etten er e Engine Softwar Wednesday, March 25, 2009
  • 22. Daan van Etten er e Engine Softwar Wednesday, March 25, 2009
  • 24. What is Scala ? Wednesday, March 25, 2009
  • 26. Scala History Wednesday, March 25, 2009
  • 27. Scala 1958 Wednesday, March 25, 2009
  • 28. Scala Martin Odersky Wednesday, March 25, 2009
  • 30. Scala Compilers Wednesday, March 25, 2009
  • 31. Scala Functional languages Wednesday, March 25, 2009
  • 32. Scala Functional languages (more about that later) Wednesday, March 25, 2009
  • 34. Scala Generic Java Wednesday, March 25, 2009
  • 36. Scala Java 5 Generics Wednesday, March 25, 2009
  • 37. Scala New javac Wednesday, March 25, 2009
  • 38. Scala 2001 Wednesday, March 25, 2009
  • 39. Scala Scala Wednesday, March 25, 2009
  • 40. Scala First release Wednesday, March 25, 2009
  • 41. Scala 2003 Wednesday, March 25, 2009
  • 42. Scala Object Oriented Wednesday, March 25, 2009
  • 43. Scala Functional Wednesday, March 25, 2009
  • 44. Scala Statically typed Wednesday, March 25, 2009
  • 45. Scala Type inference Wednesday, March 25, 2009
  • 46. Scala Type inference var foo = 8 Wednesday, March 25, 2009
  • 47. Scala Type inference var foo = 8 foo = “bar” Wednesday, March 25, 2009
  • 48. Scala Type inference type mismatch; var foo = 8 found: String(quot;barquot;) foo = “bar” required: Int Wednesday, March 25, 2009
  • 49. Scala Every value is an object Wednesday, March 25, 2009
  • 50. Scala Every value is an object var foo = 8 Wednesday, March 25, 2009
  • 51. Scala Every value is an object var foo = 8 def bar(a: String)= println(a) Wednesday, March 25, 2009
  • 52. Scala Every operation is a method call Wednesday, March 25, 2009
  • 53. Scala Every operation is a method call 1+3-6 Wednesday, March 25, 2009
  • 54. Scala Every operation is a method call 1+3-6 1.+(3).-(6) Wednesday, March 25, 2009
  • 55. Scala Compiles to Java bytecode Wednesday, March 25, 2009
  • 56. Scala Runs on the Java VM Wednesday, March 25, 2009
  • 57. Scala Scalable From small scripts to large systems Wednesday, March 25, 2009
  • 58. Scala Hello, World! Wednesday, March 25, 2009
  • 59. Scala object HelloWorld { def main(args: Array[String]) { println(quot;Hello, world!quot;) } } Wednesday, March 25, 2009
  • 60. Scala 20 seconds Wednesday, March 25, 2009
  • 65. Scala Functional concepts Wednesday, March 25, 2009
  • 67. Scala Design goals: Embrace immutability Avoid state Wednesday, March 25, 2009
  • 68. Scala Cleaner code Wednesday, March 25, 2009
  • 69. Scala Cleaner code More ne-grained reuse Wednesday, March 25, 2009
  • 70. Scala Cleaner code More ne-grained reuse No Iterator loops needed :-) Wednesday, March 25, 2009
  • 71. Scala Better optimizations Wednesday, March 25, 2009
  • 72. Scala Better optimizations Multi-core! Wednesday, March 25, 2009
  • 73. Scala Better optimizations Multi-core! Lazy evaluation Wednesday, March 25, 2009
  • 74. Scala Better optimizations Multi-core! Lazy evaluation Recursion Wednesday, March 25, 2009
  • 75. Scala What about the functions? Wednesday, March 25, 2009
  • 76. Scala Every operation is a method call Wednesday, March 25, 2009
  • 77. Scala Every operation is a method call 1+3-6 Wednesday, March 25, 2009
  • 78. Scala Every operation is a method call 1+3-6 1.+(3).-(6) Wednesday, March 25, 2009
  • 79. Scala Function nesting Wednesday, March 25, 2009
  • 80. Scala Function nesting def function1(x : Int) = { Wednesday, March 25, 2009
  • 81. Scala Function nesting def function1(x : Int) = { def function2() = { Wednesday, March 25, 2009
  • 82. Scala Function nesting def function1(x : Int) = { def function2() = { println(x) Wednesday, March 25, 2009
  • 83. Scala Function nesting def function1(x : Int) = { def function2() = { println(x) } Wednesday, March 25, 2009
  • 84. Scala Function nesting def function1(x : Int) = { def function2() = { println(x) } function2() Wednesday, March 25, 2009
  • 85. Scala Function nesting def function1(x : Int) = { def function2() = { println(x) } function2() } Wednesday, March 25, 2009
  • 86. Scala First-class functions Wednesday, March 25, 2009
  • 87. Scala First-class functions def foo (cb: ()=>Unit): Unit = { Wednesday, March 25, 2009
  • 88. Scala First-class functions def foo (cb: ()=>Unit): Unit = { while (true) { Wednesday, March 25, 2009
  • 89. Scala First-class functions def foo (cb: ()=>Unit): Unit = { while (true) { cb(); Thread.sleep(1000); Wednesday, March 25, 2009
  • 90. Scala First-class functions def foo (cb: ()=>Unit): Unit = { while (true) { cb(); Thread.sleep(1000); } Wednesday, March 25, 2009
  • 91. Scala First-class functions def foo (cb: ()=>Unit): Unit = { while (true) { cb(); Thread.sleep(1000); } } Wednesday, March 25, 2009
  • 92. Scala First-class functions def foo (cb: ()=>Unit): Unit = { while (true) { cb(); Thread.sleep(1000); } } foo(Unit : println(quot;hiquot;)) Wednesday, March 25, 2009
  • 93. Scala First-class functions in libraries Wednesday, March 25, 2009
  • 94. Scala First-class functions in libraries val numbers = List(2,5,8,9) Wednesday, March 25, 2009
  • 95. Scala First-class functions in libraries val numbers = List(2,5,8,9) numbers.foreach( Wednesday, March 25, 2009
  • 96. Scala First-class functions in libraries val numbers = List(2,5,8,9) numbers.foreach( (x: Int) => print(x) Wednesday, March 25, 2009
  • 97. Scala First-class functions in libraries val numbers = List(2,5,8,9) numbers.foreach( (x: Int) => print(x) ) Wednesday, March 25, 2009
  • 98. Scala Anonymous functions Wednesday, March 25, 2009
  • 99. Scala Anonymous functions ((i:Int, j:Int) => i + j)(3, 4) Wednesday, March 25, 2009
  • 100. Scala Anonymous functions ((i:Int, j:Int) => i + j)(3, 4) Java: int calc(int i, int j){ return i + j; }; calc(3, 4); Wednesday, March 25, 2009
  • 101. Scala Partially applied functions Wednesday, March 25, 2009
  • 102. Scala Partially applied functions def calc(x:Int, y:Int, z:Int)=x+y+z Wednesday, March 25, 2009
  • 103. Scala Partially applied functions def calc(x:Int, y:Int, z:Int)=x+y+z val calcPart = calc(1, _:Int, 3) Wednesday, March 25, 2009
  • 104. Scala Partially applied functions def calc(x:Int, y:Int, z:Int)=x+y+z val calcPart = calc(1, _:Int, 3) calcPart(4) Wednesday, March 25, 2009
  • 107. + Simple project Wednesday, March 25, 2009
  • 108. + Hello, Wicket World! Wednesday, March 25, 2009
  • 109. + object HelloWorld { def main(args: Array[String]) { println(quot;Hello, world!quot;) } } Wednesday, March 25, 2009
  • 110. + class HelloWorld extends WebApplication { def main(args: Array[String]) { println(quot;Hello, world!quot;) } } Wednesday, March 25, 2009
  • 111. + class HelloWorld extends WebApplication { } Wednesday, March 25, 2009
  • 112. + class HelloWorld extends WebApplication { def getHomePage = classOf[HomePage] } Wednesday, March 25, 2009
  • 113. + class HelloWorld extends WebApplication { def getHomePage = classOf[HomePage] } class HomePage extends WebPage { } Wednesday, March 25, 2009
  • 114. + class HelloWorld extends WebApplication { def getHomePage = classOf[HomePage] } class HomePage extends WebPage { } Wednesday, March 25, 2009
  • 115. + class HelloWorld extends WebApplication { def getHomePage = classOf[HomePage] } class HomePage extends WebPage { var name = quot;quot; } Wednesday, March 25, 2009
  • 116. + class HelloWorld extends WebApplication { def getHomePage = classOf[HomePage] } class HomePage extends WebPage { var name = quot;quot; val form = new Form(quot;formquot;) } Wednesday, March 25, 2009
  • 117. + class HelloWorld extends WebApplication { def getHomePage = classOf[HomePage] } class HomePage extends WebPage { var name = quot;quot; val form = new Form(quot;formquot;) add(form) } Wednesday, March 25, 2009
  • 118. + class HelloWorld extends WebApplication { def getHomePage = classOf[HomePage] } class HomePage extends WebPage { var name = quot;quot; val form = new Form(quot;formquot;) add(form) form.add(new TextField(quot;namequot;, } Wednesday, March 25, 2009
  • 119. + class HelloWorld extends WebApplication { def getHomePage = classOf[HomePage] } class HomePage extends WebPage { var name = quot;quot; val form = new Form(quot;formquot;) add(form) form.add(new TextField(quot;namequot;, new PropertyModel(this, quot;namequot;))) } Wednesday, March 25, 2009
  • 120. + class HelloWorld extends WebApplication { def getHomePage = classOf[HomePage] } class HomePage extends WebPage { var name = quot;quot; val form = new Form(quot;formquot;) add(form) form.add(new TextField(quot;namequot;, new PropertyModel(this, quot;namequot;))) form.add(new Label(quot;helloworldquot;, } Wednesday, March 25, 2009
  • 121. + class HelloWorld extends WebApplication { def getHomePage = classOf[HomePage] } class HomePage extends WebPage { var name = quot;quot; val form = new Form(quot;formquot;) add(form) form.add(new TextField(quot;namequot;, new PropertyModel(this, quot;namequot;))) form.add(new Label(quot;helloworldquot;, new PropertyModel(this, quot;namequot;))) } Wednesday, March 25, 2009
  • 122. + <body> <p><b>Hello, Wicket World!</b></p> <form wicket:id=quot;formquot;> What's your name? <br/> <input wicket:id=quot;namequot;/> <input type=quot;submitquot; value = quot;OKquot; /> <p>Your name is: <b><span wicket:id=quot;helloworldquot;/></b> </p> </form> </body> Wednesday, March 25, 2009
  • 128. EASY REUSABLE NON-INTRUSIVE SAFE EFFICIENT SCALABLE Wednesday, March 25, 2009
  • 130. EASY POJO-centric Wednesday, March 25, 2009
  • 131. EASY POJO-centric Wednesday, March 25, 2009
  • 132. EASY All code in Java Wednesday, March 25, 2009
  • 133. EASY All code in Java or Scala Wednesday, March 25, 2009
  • 134. EASY Maximum type safety and compile-time problem diagnosis Wednesday, March 25, 2009
  • 135. EASY Maximum type safety and compile-time problem diagnosis Wednesday, March 25, 2009
  • 136. EASY Minimum reliance on special tools Wednesday, March 25, 2009
  • 137. EASY Minimum reliance on special tools Wednesday, March 25, 2009
  • 140. REUSABLE Function reuse Wednesday, March 25, 2009
  • 143. NON-INTRUSIVE HTML or other markup not polluted with programming semantics Wednesday, March 25, 2009
  • 144. NON-INTRUSIVE HTML or other markup not polluted with programming semantics Wednesday, March 25, 2009
  • 145. NON-INTRUSIVE But... Scala != Java Wednesday, March 25, 2009
  • 146. NON-INTRUSIVE ? Wednesday, March 25, 2009
  • 148. SAFE Code is secure by default Wednesday, March 25, 2009
  • 149. SAFE Code is secure by default Wednesday, March 25, 2009
  • 150. SAFE All logic in Java (or Scala) with maximum type safety Wednesday, March 25, 2009
  • 151. SAFE All logic in Java (or Scala) with maximum type safety Wednesday, March 25, 2009
  • 153. EFFICIENT / SCALABLE Wednesday, March 25, 2009
  • 154. EFFICIENT / SCALABLE Efficient and lightweight Wednesday, March 25, 2009
  • 155. EFFICIENT / SCALABLE Efficient and lightweight Wednesday, March 25, 2009
  • 156. EFFICIENT / SCALABLE Scala means reducing the amount of code. Wednesday, March 25, 2009
  • 157. EFFICIENT / SCALABLE Scala means reducing the amount of code. Wednesday, March 25, 2009
  • 158. EFFICIENT / SCALABLE Wednesday, March 25, 2009
  • 160. EASY REUSABLE NON-INTRUSIVE SAFE EFFICIENT SCALABLE Wednesday, March 25, 2009
  • 165. maven maven-scala-plugin Wednesday, March 25, 2009
  • 166. maven Under <build> <plugins> <plugin> <groupId>org.scala-tools</groupId> <artifactId>maven-scala-plugin</artifactId> <executions> <execution> <goals> <goal>compile</goal>         <goal>testCompile</goal>   </goals> </execution> </executions> Wednesday, March 25, 2009
  • 167. maven Under <pluginRepositories> <pluginRepository> <id>scala</id> <name>Scala Tools</name> <url>http://scala-tools.org/repo-releases</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> Wednesday, March 25, 2009
  • 168. maven Under <repositories> <repository> <id>scala</id> <name>Scala Tools</name> <url>http://scala-tools.org/repo-releases</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> Wednesday, March 25, 2009
  • 169. maven Under <dependencies> <dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId> <version>2.7.3</version> </dependency> Wednesday, March 25, 2009
  • 170. maven You can add this to any Java+Maven project! Wednesday, March 25, 2009
  • 171. maven Project layout Wednesday, March 25, 2009
  • 172. maven pom.xml src main java test java Wednesday, March 25, 2009
  • 173. maven pom.xml src main scala test scala Wednesday, March 25, 2009
  • 174. maven pom.xml src main java scala test java scala Wednesday, March 25, 2009
  • 175. maven Hello, Wicket World! built in Maven Wednesday, March 25, 2009
  • 178. Download the demo project. Wednesday, March 25, 2009
  • 181. Java Scala Java interface implemented in Scala Wednesday, March 25, 2009
  • 182. Java Scala public interface SomeInterface { void doSomething(String argument); } Wednesday, March 25, 2009
  • 183. Java Scala public interface SomeInterface { void doSomething(String argument); } class SomeImplementation extends SomeInterface { def doSomething(argument: String):Unit = { println(argument) } } Wednesday, March 25, 2009
  • 184. Java Scala public interface SomeInterface { ? void doSomething(String argument); } class SomeImplementation extends SomeInterface { def doSomething(argument: String):unit = { println(argument) } } Wednesday, March 25, 2009
  • 185. Java Scala Scala does not have interfaces! Wednesday, March 25, 2009
  • 186. Java Scala Scala has traits Wednesday, March 25, 2009
  • 187. Java Scala extending a trait class SomeImplementation extends SomeInterface { def doSomething(argument: String) : unit = { println(argument) } } Wednesday, March 25, 2009
  • 188. Java Scala interface != trait Wednesday, March 25, 2009
  • 189. Java Scala traits can have method implementations Wednesday, March 25, 2009
  • 190. Java Scala public interface SomeInterface { void doSomething(String argument); } trait SomeTrait { def doSomething=(argument:String):Unit } Wednesday, March 25, 2009
  • 191. Java Scala public interface SomeInterface { void doSomething(String argument); } trait SomeTrait { def doSomething(argument:String):Unit   def computeSomething = title.length * 10 } Wednesday, March 25, 2009
  • 192. Java Scala public interface SomeInterface { void doSomething(String argument); } class SomeImplementation extends SomeInterface { def doSomething(argument: String):Unit = { println(argument) } } Wednesday, March 25, 2009
  • 193. Java Scala public interface SomeInterface { void doSomething(String argument); } class SomeImplementation extends SomeInterface { } Wednesday, March 25, 2009
  • 194. Java Scala Error: class SomeImplementation needs to be abstract since method doSomething in trait SomeInterface of type (java.lang.String)Unit is not defined. Wednesday, March 25, 2009
  • 195. Java Scala Java and Scala combined: Circular dependencies Wednesday, March 25, 2009
  • 197. Java Scala public interface SomeInterface { void doSomething(String argument); } Wednesday, March 25, 2009
  • 198. Java Scala public interface SomeInterface { void doSomething(String argument); } class SomeImplementation extends SomeInterface { def doSomething=(argument:String):Unit {...} } Wednesday, March 25, 2009
  • 199. Java Scala public interface SomeInterface { void doSomething(String argument); } class SomeImplementation extends SomeInterface { def doSomething=(argument:String):Unit {...} } public class Other extends SomeImplementation { ... } Wednesday, March 25, 2009
  • 200. Java Scala maven-scala-plugin Wednesday, March 25, 2009
  • 201. Java Scala maven-scala-plugin Handles circular dependencies! Wednesday, March 25, 2009
  • 202. Java Scala How? Wednesday, March 25, 2009
  • 204. Java Scala scalac parses Java code (since 2.7.2) Wednesday, March 25, 2009
  • 205. Java Scala public interface SomeInterface { void doSomething(String argument); } class SomeImplementation extends SomeInterface { def doSomething=(argument:String):Unit {...} } public class Other extends SomeImplementation { ... } Wednesday, March 25, 2009
  • 209. Scala home on the web. Reference manuals, tutorials, news, speci cations. http://www.scala-lang.org Wednesday, March 25, 2009
  • 210. Interpreter, variables, methods, loops, arrays, lists, tuples, sets, maps, classes, singletons, traits, mixins. http://www.artima.com/scalazine/articles/steps.html Wednesday, March 25, 2009
  • 211. Multiple articles covering a feature by feature comparison of Scala and Java http://blogs.sun.com/sundararajan/entry/scala_for_java_programmers Wednesday, March 25, 2009
  • 212. Series of 6 great articles covering a lot of Scala. Aimed at Java developers. http://www.codecommit.com/blog/scala/roundup-scala-for-java-refugees Wednesday, March 25, 2009
  • 213. Scala Wiki. FAQ, code samples, design patterns, Scala job openings http://scala.sygneca.com/ Wednesday, March 25, 2009
  • 214. Official mailing lists Subscribe: empty message to scala-subscribe@listes.ep .ch http://www.scala-lang.org/node/199 Wednesday, March 25, 2009
  • 215. All samples can be downloaded at http://stuq.nl Wednesday, March 25, 2009
  • 216. Get started with Scala and Wicket! Wednesday, March 25, 2009

Editor's Notes

  1. http://www.artima.com/weblogs/viewpost.jsp?thread=163733
  2. Lausanne
  3. Pizza is an open-source superset of the Java programming language with the following new features: Generics Function pointers Class cases and pattern matching (a.k.a Algebraic types)
  4. Started designing Scala in 2001
  5. In 2001, the design for Scala started
  6. Scala, whose design began in 2001, and which was first released in 2003. Scala is not an extension of Java, but it is completely interoperable with it. Scala translates to Java bytecodes, and the efficiency of its compiled programs usually equals Java's. A second implementation of Scala compiles to .NET. (this version is currently out of date, however). Scala was designed to be both object-oriented and functional. It is a pure object-oriented language in the sense that every value is an object. Objects are defined by classes, which can be composed using mixin composition. Scala is also a functional language in the sense that every function is a value. Functions can be nested, and they can operate on data using pattern matching.
  7. 2003, first release of Scala
  8. From the start, Scala is functional and object oriented, like Java
  9. From the start, Scala is purely functional. functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data.
  10. Like Java, unlike Groovy
  11. This also works with functions def sayHello = System.out.println(\"hello world\")
  12. This also works with functions def sayHello = System.out.println(\"hello world\")
  13. This also works with functions def sayHello = System.out.println(\"hello world\")
  14. This also works with functions def sayHello = System.out.println(\"hello world\")
  15. The + is a method defined in class Int
  16. The + is a method defined in class Int
  17. The name Scala stands for &#x201C;scalable language.&#x201D; The language is so named because it was designed to grow with the demands of its users. You can apply Scala to a wide range of programming tasks, from writing small scripts to building large systems.
  18. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  19. Functional programming languages generally avoid state and try to have immutability
  20. The + is a method defined in class Int
  21. The + is a method defined in class Int
  22. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  23. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  24. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  25. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  26. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  27. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  28. Higher order functions accept functions as parameters and return functions too.
  29. Higher order functions accept functions as parameters and return functions too.
  30. Higher order functions accept functions as parameters and return functions too.
  31. Higher order functions accept functions as parameters and return functions too.
  32. Higher order functions accept functions as parameters and return functions too.
  33. Higher order functions accept functions as parameters and return functions too.
  34. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  35. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  36. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  37. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  38. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  39. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  40. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  41. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).
  42. Erlang,[2] OCaml,[3] Haskell,[4] Scheme[5][6] and domain-specific programming languages like R (statistics),[7] Mathematica (symbolic math),[8] J and K (financial analysis), and XSLT (XML).