Tic Tac Toe in Lift

988 views

Published on

Slides from my lightning talk on writing a real time, two player implementation of Tic Tac Toe in Scala and Lift. The source code can be found on http://github.com/erlendfh/lift-tictactoe

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
988
On SlideShare
0
From Embeds
0
Number of Embeds
35
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Tic Tac Toe in Lift

    1. 1. Lift The simply functional web framework
    2. 2. Scala • Kjører på JVM’en (og CLR) • Sterkt typet • Typeinferens • Hybrid mellom funksjonelt og objektorientert
    3. 3. Lift • Skrevet i Scala • Forsøk på (nok en gang) å plukke de beste aspektene av konkurrerende rammeverk • Komponent-orientert (a’la Wicket, Tapestry) • View-first
    4. 4. Tic Tac Toe
    5. 5. Tic Tac Toe Server Client O TicTacToeClient X TicTacToeServer TicTacToeClient O X
    6. 6. Actors • Basert på Erlangs Actor model • Abstraksjon av tråder • Meldingsbasert • Thread pool
    7. 7. object PingPong extends Application { var count = 0; val pong = actor { loop { react { case Ping => println("Actor Pong Received Ping") sender ! Pong case Stop => println("Stopping Pong") exit() } } } val ping = actor { pong ! Ping loop { react { case Pong => println("Actor Ping Received Pong") count = count + 1; if (count < 3) { sender ! Ping } else { sender ! Stop println("Stopping Ping") exit() } } } } } case object Ping case object Pong case object Stop
    8. 8. DEMO!

    ×