Lift web framework

Post on 15-May-2015

1389 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Lift web framework is one of the most popular parts of Scala ecosystem. Thanks to many innovative features and its use in projects such as foursquare or snapsort, this web framework popularity is skyrocketing. Moreover, for many developers, this web framework is the main reason to study Scala programming language.

Transcript

Petr Hošek @petrh

CZJUG, December 2010

Why do we need another web framework?

„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 very rapid port from our previous platform.“

Harry Heymann,

„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 the plumbing. “

David LaPalomento,

„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 of the status quo, it redefines the state-of-the-art. If you are a web developer, you should learn Lift. “

Michael Galpin,

„The fact that Lift-based applications run unchanged on the SAP's NetWeaver CE Java application server makes this an intriguing approach for enterprise applications in the SAP world.“

Darren Hague,

Overall View

Expressive elegant web frameworkCombines best of other frameworks

Powered by languageModern object-functional JVM language

View First Approach

View-Driven DevelopmentSimilar to MVC but not exactly the same

No business code allowed in the viewUsually represents „seep“ of business logic

Designer friendly markup contentViews are well-formed XHTML/HTML5

vs

Model-View-Controller View-Driven-Development

Snippets

Snippet provides rendering logicCalled arbitrarily times on multiple pages

Snippet is Scala class or objectFunctions transforming sequence of XML nodes

Snippets can be stateful or statelessUsing session affinity

No hidden magic or code plumbingEverything is just well designed

AJAX & Comet

Native support for AJAX and CometProbably best support available today

JavaScript becomes Scala functionsUsing Scala function callbacks for AJAX

Abstracts underlying JavaScript libraries

Support for JQuery, YUI and ExtJS

Comet support through ActorsSending/receiving messages to/from browser

Utilizes long-pollingFuture use of HTML5 web sockets

Provides inherent securityUsing opaque GUIDs for AJAX & Comet URLs

Persistence Support

Mapper persistence frameworkOriginal persistence framework

Lightweight object-relational mappingSimilar design to ActiveRecord

Support for common relational databases

MySQL, PostgreSQL, Oracle Database, etc.

Support for different persistence systems

Hibernate, JPA, etc.

Record persistence frameworkNew store-agnostic persistence

framework

Support for different storesMongoDB, CouchDB, Squeryl, etc.

Easy to develop custom back-endAutomatic validation,CRUD and REST support

REST & WebServices

Built-in REST and WebService supportUsing either simple DSL or full dispatching

Both statefull and statelessDeclarative rules for URI dispatching

DSL for JSON constructionExtremely fast serialization/deserialization

First-class XML supportNative part of Scala language

Modularity

Lift uses modular architectureUsing Apache Maven artifacts

Many existing modules available to useJust add dependency into your project

Security

Out-of-the-box securityNo vulnerability from the Top Ten

Difficult to introduce vulnerabilitiesDevelopers needs to make an effort

Page elements have opaque GUIDsUsed to reference server components

AJAX and Comet use similar GUIDsSensitive data are not exposed

Persistence safe from SQL injectionSQL queries sanitization enforcement

Scalability

Support for database shardingUsing federation of database servers

Using non-blocking input/outputOut-of-the-box support for Jetty Continuations

Decoupling threads from requestsImplemented via Scala Actors

Negatives & Drawbacks

The good, the bad and the uglyLift has downsides as well

Framework „takes over control“What is happening in the background?

Documentation is insufficientMany important details are missing

Exploring Lift book is incompleteUpcoming Lift in Action book is still in EAP

No direct tool supportRelated to insufficient Scala tool support

Summary

Lift makes the web development simpleLift combines many ideas & methodologiesLift has new take on web developmentLift is inherently secureLift has excellent AJAX and Comet supportLift is already proven in the industry

Content adapted from Lift in Action bookTimothy Perrett, Manning Publications, 2011

Content adapted from Exploring Lift bookDerek Chen-Becker, Marius Danciu and Tyler Weir, 2009

Content adapted from official website liftweb.netCourtesy of WorldWide Conferencing, LLC

top related