Lift is the most powerful, most secure web framework available today

scala 1You’ve probably heard about the growth of functional programming languages, and of Scala in particular. What you might be wondering is what that means for web frameworks, and that’s where Lift fits in.

LiftLift is an open source web framework, built for the Scala programming language, and started by David Pollak in 2007. Version 1.0 shipped in 2009, and the latest version, 2.5.1, was released in June 2013.

The “most powerful, most secure” title of this post is taken from the Lift home page. That power and security comes from Lift’s different approach to web development–it’s not another MVC framework, but instead has a different emphasis on development.

For example, templates (pages) in Lift have the property of being designer friendly. That means a designer can work on the page without having to gingerly step around any server-side scripting elements. That’s because Lift uses CSS classes to mark areas of a page for replacement on the server. Web editing tools work well with this, and Lift can get on and use the content without changes.

Another example is the way HTML form elements can be connected back to functions on the server. In some frameworks you wire a URL to code, extract values, and do something with them. You can do that in Lift, but you also have the ability to bind a function to input fields and forms. Your function can focus on what it needs to do, and Lift will take care of calling your function at the right time.

This form processing style extends nicely to Ajax. That function you wrote and connected to, say, a button, could just as easily return data or JavaScript back to the browser. The client/server round-trip is taken care of for you. Lift is great at getting this “plumbing” out of your way.

Features like this give great power but can be confusing at first. A tweet from a new Lift user captures it well:

My understanding of Lift improved by hanging out on the mailing list. Not just by asking questions, but by learning from what others in the community were discussing. I eventually tried to help answer some questions, which I think is a great way of learning. At about the same time my confidence was given a boost by seeing that FourSquare were using Lift. It’s an indicator that the technology is serious: that site has plenty of traffic.

I further grew my experience in Lift by building applications, first for internal company use, and then rolling out Lift for customers.

The “coding up a storm” comment about fun and productivity rings true for me. It’s probably most obvious in Lift’s superb Comet and Ajax support. This makes Lift a great platform for building interactive sites, from subtle server-push page updates to a dashboard, through to full social applications.

When it comes to other aspects of web development, Lift doesn’t force you down any particular route. With databases, for example, you get to pick what you want to use and how you want to work with it. Lift Record works well with relational databases, MongoDB and CouchDB. But you don’t have to use it if there’s something else you’d prefer, and you’re not going to miss out on the other features of Lift by going your own way.

Lift is productive, powerful, secure, mature, and has a great community. You can dig a little deeper in the three posts and small code examples I’ve posted at programming.oreilly.com. They cover REST, designer-friendly templates, Ajax, Comet, JavaScript and couple of other features of Lift. You should also check out the examples of Seven Things that makes Lift different.

 

Lift cookbookRichard Dallaway is a partner at Underscore Consulting, the UK’s leading Scala consultancy, where he works on delivering software projects for clients. He’s a committer on the Lift project, focusing mainly on the modules system, and author of The Lift Cookbook: Recipes from the Community for Building Web Applications with Scala, published by O’Reilly.

Leave a Reply