SlideShare une entreprise Scribd logo
1  sur  8
Lift
The simply functional web framework
Scala


• Kjører på JVM’en (og CLR)
• Sterkt typet
• Typeinferens
• Hybrid mellom funksjonelt og objektorientert
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
Tic Tac Toe
Tic Tac Toe
                   Server           Client


                                             O
                  TicTacToeClient
                                                 X




TicTacToeServer




                  TicTacToeClient
                                             O
                                                 X
Actors

• Basert på Erlangs Actor model
• Abstraksjon av tråder
• Meldingsbasert
• Thread pool
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
DEMO!

Contenu connexe

En vedette

Introducing mark lynch
Introducing mark lynchIntroducing mark lynch
Introducing mark lynchmelynch
 
siKMcall Oct18,2011-tomshort
siKMcall Oct18,2011-tomshortsiKMcall Oct18,2011-tomshort
siKMcall Oct18,2011-tomshortTom Short
 
Lynch_Mark
Lynch_MarkLynch_Mark
Lynch_Markmelynch
 
Lynch mark
Lynch markLynch mark
Lynch markmelynch
 
No Ls Roth Ira Conversions And Estate Planning In 2010
No Ls Roth Ira Conversions And Estate Planning In 2010No Ls Roth Ira Conversions And Estate Planning In 2010
No Ls Roth Ira Conversions And Estate Planning In 2010TreyWebb
 
Book Chapter: KM Lessons Learned
Book Chapter: KM Lessons LearnedBook Chapter: KM Lessons Learned
Book Chapter: KM Lessons LearnedTom Short
 
Solution Tree PLC Luncheon Presentation
Solution Tree PLC Luncheon PresentationSolution Tree PLC Luncheon Presentation
Solution Tree PLC Luncheon Presentationchrismorgan
 
Management systems
Management systemsManagement systems
Management systemsmelynch
 
Solution Tree PLC at Work Services
Solution Tree PLC at Work ServicesSolution Tree PLC at Work Services
Solution Tree PLC at Work Serviceschrismorgan
 
Solution Deliverable Process Analysis V1
Solution Deliverable Process Analysis V1Solution Deliverable Process Analysis V1
Solution Deliverable Process Analysis V1Tom Short
 
Slo Demonstration For Web
Slo Demonstration For WebSlo Demonstration For Web
Slo Demonstration For Webtayapage
 
Energy Efficient Geographical Forwarding Algorithm For Wireless Ad Hoc And Se...
Energy Efficient Geographical Forwarding Algorithm For Wireless Ad Hoc And Se...Energy Efficient Geographical Forwarding Algorithm For Wireless Ad Hoc And Se...
Energy Efficient Geographical Forwarding Algorithm For Wireless Ad Hoc And Se...zhendong
 
1 Windows 7 And Windows Xp Mode
1 Windows 7 And Windows Xp Mode1 Windows 7 And Windows Xp Mode
1 Windows 7 And Windows Xp ModejohnbakerMS
 
Leach-Protocol
Leach-ProtocolLeach-Protocol
Leach-Protocolzhendong
 

En vedette (17)

Introducing mark lynch
Introducing mark lynchIntroducing mark lynch
Introducing mark lynch
 
siKMcall Oct18,2011-tomshort
siKMcall Oct18,2011-tomshortsiKMcall Oct18,2011-tomshort
siKMcall Oct18,2011-tomshort
 
2 Boot To Vhd
2 Boot To Vhd2 Boot To Vhd
2 Boot To Vhd
 
Peno1 I S S2009
Peno1 I S S2009Peno1 I S S2009
Peno1 I S S2009
 
REST Basics
REST BasicsREST Basics
REST Basics
 
Lynch_Mark
Lynch_MarkLynch_Mark
Lynch_Mark
 
Lynch mark
Lynch markLynch mark
Lynch mark
 
No Ls Roth Ira Conversions And Estate Planning In 2010
No Ls Roth Ira Conversions And Estate Planning In 2010No Ls Roth Ira Conversions And Estate Planning In 2010
No Ls Roth Ira Conversions And Estate Planning In 2010
 
Book Chapter: KM Lessons Learned
Book Chapter: KM Lessons LearnedBook Chapter: KM Lessons Learned
Book Chapter: KM Lessons Learned
 
Solution Tree PLC Luncheon Presentation
Solution Tree PLC Luncheon PresentationSolution Tree PLC Luncheon Presentation
Solution Tree PLC Luncheon Presentation
 
Management systems
Management systemsManagement systems
Management systems
 
Solution Tree PLC at Work Services
Solution Tree PLC at Work ServicesSolution Tree PLC at Work Services
Solution Tree PLC at Work Services
 
Solution Deliverable Process Analysis V1
Solution Deliverable Process Analysis V1Solution Deliverable Process Analysis V1
Solution Deliverable Process Analysis V1
 
Slo Demonstration For Web
Slo Demonstration For WebSlo Demonstration For Web
Slo Demonstration For Web
 
Energy Efficient Geographical Forwarding Algorithm For Wireless Ad Hoc And Se...
Energy Efficient Geographical Forwarding Algorithm For Wireless Ad Hoc And Se...Energy Efficient Geographical Forwarding Algorithm For Wireless Ad Hoc And Se...
Energy Efficient Geographical Forwarding Algorithm For Wireless Ad Hoc And Se...
 
1 Windows 7 And Windows Xp Mode
1 Windows 7 And Windows Xp Mode1 Windows 7 And Windows Xp Mode
1 Windows 7 And Windows Xp Mode
 
Leach-Protocol
Leach-ProtocolLeach-Protocol
Leach-Protocol
 

Tic Tac Toe in Lift

  • 2. Scala • Kjører på JVM’en (og CLR) • Sterkt typet • Typeinferens • Hybrid mellom funksjonelt og objektorientert
  • 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
  • 5. Tic Tac Toe Server Client O TicTacToeClient X TicTacToeServer TicTacToeClient O X
  • 6. Actors • Basert på Erlangs Actor model • Abstraksjon av tråder • Meldingsbasert • Thread pool
  • 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