SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Getting Real Lift, the web framework for Scala Timothy PerrettJavaZone 2010
About Me ,[object Object]
Author of Lift in ActionCoding Scala since 2007 ,[object Object]
Manufacturing and marketing automation is my day jobhttp://manning.com/perrett/
Agenda Overview of Lift Differentiators and rationale Lift’s architecture Some awesome features A few words from our users
What is Lift? Framework for building highly interactiveweb applications 4 years old, founded by David Pollak Heavily leverages Scala language features Takes the best ideas from other frameworks Makes real-time web applications accessible
Yet another framework? Developers needn't be plumbers Unifies the best of other framework concepts  Granular sessions and security a la Seaside  Convention over configuration a la Rails  Designer friendly templates a la Wicket Advanced features like comet work OOTB Tough to be truly real-time with existing tech
Why Scala for Lift? New breed of JVM language Real-time means events; synergy with Actors Promotes better coding Great libraries Yields more maintainable applications Fewer defects because of immutability & type system Better distribution and parallelism
Enterprise Ready
Enterprise Ready ~75m users at the end of 2009 ~6m new users month on month 50m+ tweets daily Services 3x as much traffic with Scala
Enterprise Ready ~3m users ~150m “check-ins” All “S.LI.M” stack 14k LOC rewritten in 90 days Service 3x as much traffic compared to LAMP
Key Differentiators Unparalleled out of the box security No single vulnerability from the OWASP Top Ten  Unique “view first” architecture The best comet support available today All contributions are “rights assigned” Safe for enterprise Assured open source HTTP provider agnostic
View First What’s the matter with my controllers?!
Controller dispatched style
Controller dispatched style
Lift’s “View First” style
Lift’s “View First” Model It’s not MVC Your typical page has more than a single piece of dynamic content Code in the view usually means some “seep” of business logic: thus, NO code in the view Designer friendly dynamic content markup Only well-formed XHTML; no string replacement – e.g. {{myvar}}
Lift’s “View First” Model
Snippets A “snippet” in Lift represents a collection of rendering logic One snippet can be called on nnumber of pages, n number of times A snippet is a normal Scala class or object Its not magic, its just well designed Essentially NodeSeq => NodeSeq function
Snippets class Example { def nameForm(xhtml: NodeSeq) = { varname = “” def doSubmit { println(“Submitted…”) } bind("f", xhtml,  "name" -> SHtml.text(name, name = _), "submit" -> SHtml.submit(doSubmit _)     )   } } <lift:example.name_form>   <p><f:name /></p>   <p><f:submit /></p> </lift:example.name_form>
Statefulvs Stateless So called “share nothing” architecture is flawed.  The state is just pushed elsewhere (RDBMS, Cookie) Twitter “fail whale” part of pop culture because “share nothing” didn’t scale Session affinity IS workable for large scale production applications (e.g. foursquare)
Security Developers must to work hard to introduce vulnerabilities in their applications Page elements have session-specific opaque GUIDs to reference server components (impossible to do CSRF) AJAX and Comet functions also use similar GUIDs so that sensitive IDs etc are not exposed Persistence is safe from SQL injection
Security “Four stars to @foursquare - 1st site in a while I have taken a good look at that didn't have a single security issue (that I could find)” RasmusLerdorf, Inventor of PHP
AJAX It’s super simple Just define the desired () => JsCmd callback It’s super secure Randomly maps opaque GUIDs to AJAX urls It abstracts underlying Javascript libraries Currently supports JQuery, YUI and ExtJS Calling JS just becomes a Scala function
AJAX // snippet class JavaZone {   def example(xhtml: NodeSeq) = bind("x", xhtml,  "button" -> SHtml.ajaxButton(Text("Press me"),        () => SetHtml("sampleDiv", Text("That's it")))) } <!-- markup --> <lift:java_zone.example>   <div id="sampleDiv"><x:button /></div> </lift:java_zone.example> POST - /ajax_request/F12814029028330FO/
Comet SpecilizedLiftActor sub-type: CometActor Its just an actor… thing ! Message(whatever) Receiving messages pushes to the browser No magic beans Utilizes long-polling Soon to be auto-detecting web sockets! Multiple comet actors delta updates over a managed browser connections.
Demo No, its not the obligatory chat app!
More Awesome Features
SiteMap Declarative rules for page access  Enforced long before the page content is processed or rendered – it’s very fast. Can generate site menus complete with complex rules based on application state Unified access control model Allows highly componentized functionality
Persistence: Mapper ActiveRecord style ORM Good for average size projects Supports most common RDBMS MySQL, PostGRE, MSSQL, Oracle etc OOTB support with other Lift components Generate CRUD interfaces via CRUDify
Persistence: Record Completely store agnostic Mongo DB Couch DB Squeryl Keeps the meaning with the bytes Integrates seamlessly with other Lift components such as Wizard Automatic REST
Persistence: Record valuser = from(users)(u =>  where(u.email === email) select(u)) class User extends Record[User] with KeyedRecord[User]{   def meta = User  valcountry = new CountryField(this)   // rest of definition  } object User extends User with MetaRecord[User]
Wizard Single and multi-screen page flows Declarative logic Inclusive of validation Automatic persistence via Mapper or Record  Fully customizable throughout Making CRUD screens is only one line of code Fully testable divorced from HTTP
Wizard object AskAboutIceCreamextends LiftScreen { valflavor = field("What's your favorite Ice cream flavor","",        trim,        valMinLen(2, "Name too short"),       valMaxLen(40, "That's a long name")) def finish(){ S.notice("I like "+flavor.is+" too!")   } }
REST Services  Can be completely stateless Uses a simple DSL …or get close to the metal with full dispatching Lift has awesome support for JSON:  Slick DSL for construction / parsing  ~300 times faster than Scala JSON parser  Faster deserilization than Java Native, first-class XML support in Scala
REST Services  serve {     case "api" :: "sample" :: _ XmlGet _ => <p>Static</p>     case "api" :: "sample" :: _ JsonGet _ => JString("Static")   } http://localhost:8080/api/sample/thing.xml //=> <p>Static</p> http://localhost:8080/api/sample/sample.json //=> { “Static” }
Modules AMQP Textile XMPP OpenID JTA PayPal …and lots more!
Thoughts from our users
“Lift is the only new framework in the last four years to offer fresh and innovative approaches to web development. It's not just some incremental improvement over the status quo, it redefines the state of the art.” 												Michael Galpin, eBay
“Lift is the kind of web framework that enables you as a developer to concentrate on the big picture. Strong, expressive typing and higher-level features like the built-in Comet support allow you to focus on innovating instead of doing the plumbing.” 												David LaPalomento, Novell
“Foursquare switched over to Scala & Lift last year and we've been thrilled with the results. The ease of developing complex interactive AJAX web pages enabled a very rapid port from our previous platform” 											Harry Heymann, FourSquare

Weitere ähnliche Inhalte

Was ist angesagt?

Android | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted NewardAndroid | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted NewardJAX London
 
Kicking off with Zend Expressive and Doctrine ORM (ConFoo YVR 2017)
Kicking off with Zend Expressive and Doctrine ORM (ConFoo YVR 2017)Kicking off with Zend Expressive and Doctrine ORM (ConFoo YVR 2017)
Kicking off with Zend Expressive and Doctrine ORM (ConFoo YVR 2017)James Titcumb
 
Javascript session 01 - Introduction to Javascript
Javascript session 01 - Introduction to JavascriptJavascript session 01 - Introduction to Javascript
Javascript session 01 - Introduction to JavascriptLivingston Samuel
 
JavaScript Library Overview
JavaScript Library OverviewJavaScript Library Overview
JavaScript Library Overviewjeresig
 
Performance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesPerformance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesDoris Chen
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced JavascriptDhruvin Shah
 
Metaprogramming JavaScript
Metaprogramming  JavaScriptMetaprogramming  JavaScript
Metaprogramming JavaScriptdanwrong
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScriptYakov Fain
 
Why async matters
Why async mattersWhy async matters
Why async matterstimbc
 
JavaScript - Chapter 7 - Advanced Functions
 JavaScript - Chapter 7 - Advanced Functions JavaScript - Chapter 7 - Advanced Functions
JavaScript - Chapter 7 - Advanced FunctionsWebStackAcademy
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS BasicsRavi Mone
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsMatthew Beale
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationAndrew Rota
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsJulien Lecomte
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript ProgrammingRaveendra R
 

Was ist angesagt? (20)

Android | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted NewardAndroid | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted Neward
 
Kicking off with Zend Expressive and Doctrine ORM (ConFoo YVR 2017)
Kicking off with Zend Expressive and Doctrine ORM (ConFoo YVR 2017)Kicking off with Zend Expressive and Doctrine ORM (ConFoo YVR 2017)
Kicking off with Zend Expressive and Doctrine ORM (ConFoo YVR 2017)
 
Ajax
AjaxAjax
Ajax
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
Javascript session 01 - Introduction to Javascript
Javascript session 01 - Introduction to JavascriptJavascript session 01 - Introduction to Javascript
Javascript session 01 - Introduction to Javascript
 
Lecture 5 javascript
Lecture 5 javascriptLecture 5 javascript
Lecture 5 javascript
 
JavaScript Library Overview
JavaScript Library OverviewJavaScript Library Overview
JavaScript Library Overview
 
C:\fakepath\jsp01
C:\fakepath\jsp01C:\fakepath\jsp01
C:\fakepath\jsp01
 
Performance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesPerformance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best Practices
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
 
Metaprogramming JavaScript
Metaprogramming  JavaScriptMetaprogramming  JavaScript
Metaprogramming JavaScript
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Why async matters
Why async mattersWhy async matters
Why async matters
 
JavaScript - Chapter 7 - Advanced Functions
 JavaScript - Chapter 7 - Advanced Functions JavaScript - Chapter 7 - Advanced Functions
JavaScript - Chapter 7 - Advanced Functions
 
Javascript
JavascriptJavascript
Javascript
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web Standards
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP Application
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
 

Ähnlich wie Javazone 2010-lift-framework-public

Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web PerformanceAdam Lu
 
Introduction to javaScript
Introduction to javaScriptIntroduction to javaScript
Introduction to javaScriptNeil Ghosh
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSCarol McDonald
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSFSoftServe
 
Introduction to Prototype JS Framework
Introduction to Prototype JS FrameworkIntroduction to Prototype JS Framework
Introduction to Prototype JS FrameworkMohd Imran
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesJohn Brunswick
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingHoat Le
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalystdwm042
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentationipolevoy
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran TochAdil Jafri
 
Struts2
Struts2Struts2
Struts2yuvalb
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2wiradikusuma
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologiesgeorge.james
 

Ähnlich wie Javazone 2010-lift-framework-public (20)

Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web Performance
 
Jsp
JspJsp
Jsp
 
Introduction to javaScript
Introduction to javaScriptIntroduction to javaScript
Introduction to javaScript
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
 
Introduction to Prototype JS Framework
Introduction to Prototype JS FrameworkIntroduction to Prototype JS Framework
Introduction to Prototype JS Framework
 
Jsp 01
Jsp 01Jsp 01
Jsp 01
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
 
JavaScript
JavaScriptJavaScript
JavaScript
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction Training
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalyst
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Javascript
JavascriptJavascript
Javascript
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
 
Struts2
Struts2Struts2
Struts2
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
 
PPT
PPTPPT
PPT
 
Jquery 1
Jquery 1Jquery 1
Jquery 1
 

Mehr von Timothy Perrett

Nelson: Rigorous Deployment for a Functional World
Nelson: Rigorous Deployment for a Functional WorldNelson: Rigorous Deployment for a Functional World
Nelson: Rigorous Deployment for a Functional WorldTimothy Perrett
 
Online Experimentation with Immutable Infrastructure
Online Experimentation with Immutable InfrastructureOnline Experimentation with Immutable Infrastructure
Online Experimentation with Immutable InfrastructureTimothy Perrett
 
Enterprise Algebras, Scala World 2016
Enterprise Algebras, Scala World 2016Enterprise Algebras, Scala World 2016
Enterprise Algebras, Scala World 2016Timothy Perrett
 
Large-scale Infrastructure Automation at Verizon
Large-scale Infrastructure Automation at VerizonLarge-scale Infrastructure Automation at Verizon
Large-scale Infrastructure Automation at VerizonTimothy Perrett
 
Reasonable RPC with Remotely
Reasonable RPC with RemotelyReasonable RPC with Remotely
Reasonable RPC with RemotelyTimothy Perrett
 
Building Enigma with State Monad & Lens
Building Enigma with State Monad & LensBuilding Enigma with State Monad & Lens
Building Enigma with State Monad & LensTimothy Perrett
 
Functional Programming at Verizon
Functional Programming at VerizonFunctional Programming at Verizon
Functional Programming at VerizonTimothy Perrett
 
Scalalable Language for a Scalable Web
Scalalable Language for a Scalable WebScalalable Language for a Scalable Web
Scalalable Language for a Scalable WebTimothy Perrett
 
Javazone 2011: Goal Directed Web Applications
Javazone 2011: Goal Directed Web ApplicationsJavazone 2011: Goal Directed Web Applications
Javazone 2011: Goal Directed Web ApplicationsTimothy Perrett
 
Concurrency and Parallelism with Scala
Concurrency and Parallelism with ScalaConcurrency and Parallelism with Scala
Concurrency and Parallelism with ScalaTimothy Perrett
 
Scaladays 2011: Task Driven Scala Web Applications
Scaladays 2011: Task Driven Scala Web ApplicationsScaladays 2011: Task Driven Scala Web Applications
Scaladays 2011: Task Driven Scala Web ApplicationsTimothy Perrett
 
Devoxx 2009: The Lift Framework
Devoxx 2009: The Lift FrameworkDevoxx 2009: The Lift Framework
Devoxx 2009: The Lift FrameworkTimothy Perrett
 

Mehr von Timothy Perrett (15)

Nelson: Rigorous Deployment for a Functional World
Nelson: Rigorous Deployment for a Functional WorldNelson: Rigorous Deployment for a Functional World
Nelson: Rigorous Deployment for a Functional World
 
Online Experimentation with Immutable Infrastructure
Online Experimentation with Immutable InfrastructureOnline Experimentation with Immutable Infrastructure
Online Experimentation with Immutable Infrastructure
 
Enterprise Algebras, Scala World 2016
Enterprise Algebras, Scala World 2016Enterprise Algebras, Scala World 2016
Enterprise Algebras, Scala World 2016
 
Large-scale Infrastructure Automation at Verizon
Large-scale Infrastructure Automation at VerizonLarge-scale Infrastructure Automation at Verizon
Large-scale Infrastructure Automation at Verizon
 
Reasonable RPC with Remotely
Reasonable RPC with RemotelyReasonable RPC with Remotely
Reasonable RPC with Remotely
 
Building Enigma with State Monad & Lens
Building Enigma with State Monad & LensBuilding Enigma with State Monad & Lens
Building Enigma with State Monad & Lens
 
Functional Programming at Verizon
Functional Programming at VerizonFunctional Programming at Verizon
Functional Programming at Verizon
 
Scalalable Language for a Scalable Web
Scalalable Language for a Scalable WebScalalable Language for a Scalable Web
Scalalable Language for a Scalable Web
 
BRUG - Hello, Scala
BRUG - Hello, ScalaBRUG - Hello, Scala
BRUG - Hello, Scala
 
Scala Helix
Scala HelixScala Helix
Scala Helix
 
Javazone 2011: Goal Directed Web Applications
Javazone 2011: Goal Directed Web ApplicationsJavazone 2011: Goal Directed Web Applications
Javazone 2011: Goal Directed Web Applications
 
Concurrency and Parallelism with Scala
Concurrency and Parallelism with ScalaConcurrency and Parallelism with Scala
Concurrency and Parallelism with Scala
 
Scaladays 2011: Task Driven Scala Web Applications
Scaladays 2011: Task Driven Scala Web ApplicationsScaladays 2011: Task Driven Scala Web Applications
Scaladays 2011: Task Driven Scala Web Applications
 
Bathcamp 2010-riak
Bathcamp 2010-riakBathcamp 2010-riak
Bathcamp 2010-riak
 
Devoxx 2009: The Lift Framework
Devoxx 2009: The Lift FrameworkDevoxx 2009: The Lift Framework
Devoxx 2009: The Lift Framework
 

Kürzlich hochgeladen

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Kürzlich hochgeladen (20)

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

Javazone 2010-lift-framework-public

  • 1. Getting Real Lift, the web framework for Scala Timothy PerrettJavaZone 2010
  • 2.
  • 3.
  • 4. Manufacturing and marketing automation is my day jobhttp://manning.com/perrett/
  • 5. Agenda Overview of Lift Differentiators and rationale Lift’s architecture Some awesome features A few words from our users
  • 6. What is Lift? Framework for building highly interactiveweb applications 4 years old, founded by David Pollak Heavily leverages Scala language features Takes the best ideas from other frameworks Makes real-time web applications accessible
  • 7. Yet another framework? Developers needn't be plumbers Unifies the best of other framework concepts Granular sessions and security a la Seaside Convention over configuration a la Rails Designer friendly templates a la Wicket Advanced features like comet work OOTB Tough to be truly real-time with existing tech
  • 8. Why Scala for Lift? New breed of JVM language Real-time means events; synergy with Actors Promotes better coding Great libraries Yields more maintainable applications Fewer defects because of immutability & type system Better distribution and parallelism
  • 10. Enterprise Ready ~75m users at the end of 2009 ~6m new users month on month 50m+ tweets daily Services 3x as much traffic with Scala
  • 11. Enterprise Ready ~3m users ~150m “check-ins” All “S.LI.M” stack 14k LOC rewritten in 90 days Service 3x as much traffic compared to LAMP
  • 12. Key Differentiators Unparalleled out of the box security No single vulnerability from the OWASP Top Ten Unique “view first” architecture The best comet support available today All contributions are “rights assigned” Safe for enterprise Assured open source HTTP provider agnostic
  • 13. View First What’s the matter with my controllers?!
  • 17. Lift’s “View First” Model It’s not MVC Your typical page has more than a single piece of dynamic content Code in the view usually means some “seep” of business logic: thus, NO code in the view Designer friendly dynamic content markup Only well-formed XHTML; no string replacement – e.g. {{myvar}}
  • 19. Snippets A “snippet” in Lift represents a collection of rendering logic One snippet can be called on nnumber of pages, n number of times A snippet is a normal Scala class or object Its not magic, its just well designed Essentially NodeSeq => NodeSeq function
  • 20. Snippets class Example { def nameForm(xhtml: NodeSeq) = { varname = “” def doSubmit { println(“Submitted…”) } bind("f", xhtml, "name" -> SHtml.text(name, name = _), "submit" -> SHtml.submit(doSubmit _) ) } } <lift:example.name_form> <p><f:name /></p> <p><f:submit /></p> </lift:example.name_form>
  • 21. Statefulvs Stateless So called “share nothing” architecture is flawed. The state is just pushed elsewhere (RDBMS, Cookie) Twitter “fail whale” part of pop culture because “share nothing” didn’t scale Session affinity IS workable for large scale production applications (e.g. foursquare)
  • 22. Security Developers must to work hard to introduce vulnerabilities in their applications Page elements have session-specific opaque GUIDs to reference server components (impossible to do CSRF) AJAX and Comet functions also use similar GUIDs so that sensitive IDs etc are not exposed Persistence is safe from SQL injection
  • 23. Security “Four stars to @foursquare - 1st site in a while I have taken a good look at that didn't have a single security issue (that I could find)” RasmusLerdorf, Inventor of PHP
  • 24. AJAX It’s super simple Just define the desired () => JsCmd callback It’s super secure Randomly maps opaque GUIDs to AJAX urls It abstracts underlying Javascript libraries Currently supports JQuery, YUI and ExtJS Calling JS just becomes a Scala function
  • 25. AJAX // snippet class JavaZone { def example(xhtml: NodeSeq) = bind("x", xhtml, "button" -> SHtml.ajaxButton(Text("Press me"), () => SetHtml("sampleDiv", Text("That's it")))) } <!-- markup --> <lift:java_zone.example> <div id="sampleDiv"><x:button /></div> </lift:java_zone.example> POST - /ajax_request/F12814029028330FO/
  • 26. Comet SpecilizedLiftActor sub-type: CometActor Its just an actor… thing ! Message(whatever) Receiving messages pushes to the browser No magic beans Utilizes long-polling Soon to be auto-detecting web sockets! Multiple comet actors delta updates over a managed browser connections.
  • 27. Demo No, its not the obligatory chat app!
  • 29. SiteMap Declarative rules for page access Enforced long before the page content is processed or rendered – it’s very fast. Can generate site menus complete with complex rules based on application state Unified access control model Allows highly componentized functionality
  • 30. Persistence: Mapper ActiveRecord style ORM Good for average size projects Supports most common RDBMS MySQL, PostGRE, MSSQL, Oracle etc OOTB support with other Lift components Generate CRUD interfaces via CRUDify
  • 31. Persistence: Record Completely store agnostic Mongo DB Couch DB Squeryl Keeps the meaning with the bytes Integrates seamlessly with other Lift components such as Wizard Automatic REST
  • 32. Persistence: Record valuser = from(users)(u => where(u.email === email) select(u)) class User extends Record[User] with KeyedRecord[User]{ def meta = User valcountry = new CountryField(this) // rest of definition } object User extends User with MetaRecord[User]
  • 33. Wizard Single and multi-screen page flows Declarative logic Inclusive of validation Automatic persistence via Mapper or Record Fully customizable throughout Making CRUD screens is only one line of code Fully testable divorced from HTTP
  • 34. Wizard object AskAboutIceCreamextends LiftScreen { valflavor = field("What's your favorite Ice cream flavor","", trim, valMinLen(2, "Name too short"), valMaxLen(40, "That's a long name")) def finish(){ S.notice("I like "+flavor.is+" too!") } }
  • 35. REST Services Can be completely stateless Uses a simple DSL …or get close to the metal with full dispatching Lift has awesome support for JSON: Slick DSL for construction / parsing ~300 times faster than Scala JSON parser Faster deserilization than Java Native, first-class XML support in Scala
  • 36. REST Services serve { case "api" :: "sample" :: _ XmlGet _ => <p>Static</p> case "api" :: "sample" :: _ JsonGet _ => JString("Static") } http://localhost:8080/api/sample/thing.xml //=> <p>Static</p> http://localhost:8080/api/sample/sample.json //=> { “Static” }
  • 37. Modules AMQP Textile XMPP OpenID JTA PayPal …and lots more!
  • 39. “Lift is the only new framework in the last four years to offer fresh and innovative approaches to web development. It's not just some incremental improvement over the status quo, it redefines the state of the art.” Michael Galpin, eBay
  • 40. “Lift is the kind of web framework that enables you as a developer to concentrate on the big picture. Strong, expressive typing and higher-level features like the built-in Comet support allow you to focus on innovating instead of doing the plumbing.” David LaPalomento, Novell
  • 41. “Foursquare switched over to Scala & Lift last year and we've been thrilled with the results. The ease of developing complex interactive AJAX web pages enabled a very rapid port from our previous platform” Harry Heymann, FourSquare
  • 42. Summary Lift makes the real-time web simple Lift is the culmination of many great ideas and proven methodologies Lift has a new take on web development Lift is effortlessly secure Lift has awesome comet support Lift is already proven in the field
  • 43. Questions? liftweb.net github.com/lift/lift twitter.com/timperrett github.com/timperrett blog.getintheloop.eu Lift in Action manning.com/perrett/ 40% discount: lift40au