Non-MVC Frameworks for Social and Web 2.0

posted by jbrisbin on August 23, 2010 08:00 AM

Trying to keep up with web development trends is a full-time job. I don't mean that as hyperbole and anyone that is actively engaged in staying on top of emerging trends in web development knows how difficult it can sometimes be.

The developers actively involved in creating the new frameworks and defining the new meta-patterns aren't always helpful, either. Some web development communities—lived out largely in the form of forums and mailling lists—can be irksome to beginners and visual learners. Many developers feel a "you should be able to figure it out by reading the source code" attitude in that community. This deters many people from trying to learn these new patterns. They wait until there is a critical mass of developers and industry attention before taking the plunge. But this presents a software community with a classic catch-22: they need users to test their code but they can't get users because their code isn't tested. The process of accumulating enough users of a framework, including the essential bloggers, tutorial writers, and industry OpenSource "patrons", can often take four or five years—sometimes longer.

This was the case with MVC (Model-View-Controller, for those new to web development) just a few short years ago. I remember going to a Java user's group meeting where Spring (during the 1.0 timeframe) was presented and I was excited. I liked how the framework was put together and it was such a pleasant alternative to hooking servlets and JSP pages to EJBs. I was so opposed to using the "accepted" J2EE methods, in fact, I wrote my own XML-based framework from scratch rather than subject myself to the overhead and complexity of a J2EE application.

Now that Spring has gained market dominance and MVC is at least a majority-accepted development pattern, it has overflowed into other web frameworks and languages—though fanboys of other languages and frameworks will graffiti your office if you so much as suggest their pet framework wasn't the first this-or-that on the block. That said, most web frameworks, no matter the language, offer some rendition of the MVC pattern—and have for years. Ruby has Rails. Python has Pylons. Java has Spring. Groovy has Grails. DotNET has MonoRail. And that's leaving several out for each language. There's even a sort-of MVC framework for Smalltalk web developers. I didn't even realize until recently there actually were Smalltalk web developers. Most frameworks also offer some kind of database persistence integration to abstract away the drudgery of working with raw SQL (the "M" in MVC).

But now that NoSQL databases are finally coming to mainstream development, the web is going truly and fully asynchronous, and the ignominious cloud architecture is spreading its shadow, the MVC design pattern is getting, in the view of a surprising number of developers, to be getting a little long in the tooth. It may seem heretical to some to suggest that the MVC design pattern doesn't always fit Web 2.0 and Social applications. Be that as it may, I hope to introduce you to a couple alternative frameworks that don't fit the MVC design pattern and are proud of it—but still offer the developer all the tools they need to meet the demands of new applications and clients. I can't show you everything, but I'll try and hit the high spots.

Pick yer Poison

I couldn't talk to everyone, of course. So I chose to talk to David Pollack, the creator of the Lift web framework to get grounded in the non-MVC pattern. Lift is written in Scala. Scala is one of a new class of development languages that run on top of the Java virtual machine and can transparently interact with Java's profligate third-party library community. Scala is not a loose, interpreted language like Groovy. Scala is functional (in the Functional Programming sense—though not purely functional), unabashedly type-safe, and compiled, not interpreted. Lift draws from the Scala language itself, as well as from the decidedly MVC frameworks that came before it.

It was clear in my discussion with David that it isn't just about Lift the framework. There is a paradigm shift embedded in Lift that is reflected in other areas of the industry and in communities that already have that four to five year bake time I mentioned earlier. He feels that MVC frameworks are "fundamentally flawed." In defense of that assertion, consider the home page of a social media site. How many segments of the page have their own, disparate pipelines of information? Are there RSS feeds embedded on the page? How about recent activity links? Updated content teasers? In an MVC framework, to accommodate all this unrelated information, the developer has to create a "HomePageController" of sorts, which is an aggregation of all that information. But very quickly, controllers multiply and become simplistic data retrieval methods that simply load a bunch of objects from the ORM and place them in the template context to be rendered by the page. Non-MVC frameworks take the approach that one ought to call a Spade a Spade and simply acknowledge that the user interface—the page itself—is the focus of the application, not an arbitrary, intermediate controller, and that it should be constituted of components embedded in it that are concerned only with their own data and event callbacks. Generally-speaking, Non-MVC frameworks abstract the entire HTTP request/response cycle such that developers only need to hook into well-defined lifecycle callbacks that may exist beyond the scope of a single HTTP request.

Lift, JSF, and ICEfaces

I would liken Lift—at least in a very general sense—to JavaServer Faces for Scala. That may not win me many fans in the Lift community, but I see things in Lift that remind me of JSF. The way JSF ties a user interface action (a la clicking a button) to a server-side method call on a stateful bean of some sort is similar to the method employed in Lift.

David explained to me that Lift intentionally takes a "view first" approach. This means each component on a page—Lift calls them "snippets"—is an instance of a Scala object that is responsible for both displaying output and processing input data; this rather than interposing an arbitrary controller object that's responsible for setting objects to be displayed by the template into some sort context and also processing input parameters from POST data that may (or just as likely may not) have come from a browser form. Because of this behavior, Lift doesn't force application code to know anything about HTTP requests. By tying application code to, say, a form button, the developer doesn't have to worry about where the data is coming from nor what to do with it. The Lift framework takes care of the logistics for you. This should be no surprise to ICEfaces or JSF developers, who have had this kind of programming paradigm in their conscienceness for a long time now.

For the visual and learn-by-example folks out there, you're probably wanting to skip ahead to the examples. Although this isn't really a technical HOWTO, here's a good example that demonstrates the functionality of Lift and ICEfaces:


All output in Lift is kept in XML format internally, so to output data from your Scala object, you would put a special XML tag in your template that is in the "lift" namespace (from the HelloWorld Lift example included whenever you create a new Lift project):

<span>Welcome to my-web-app at <b:time/></span>

In your Scala source directory you would create a Scala class named "HelloWorld", defined in a special package named "snippet" (which is actually a sub-package of your project package name). For the purposes of our example, the snippet class would be "". In that Scala class we would define a function named "howdy". Lift knows to call this function because the XML tag name is an aggregation of the class name (you can even lowercase it and put underscores between words: "hello_world" would work, too), a dot ".", and the function name. A simplified example of the actual Scala method would be:

class HelloWorld {
def howdy(xhtml: NodeSeq): NodeSeq = 
Helpers.bind("b", xhtml,
"time" -> Text(date.toString))

You might recognize some of the syntax of Scala if you're familiar with ActionScript. In particular, types come after variable names (after the colon). Unlike ActionScript, however, functions are always assigned with an equals sign and the language itself is type safe. Without going into too much detail (this isn't a HOWTO, remember), this function demonstrates a lot of powerful Lift functionality.


ICEfaces (and plain JSF applications, for that matter) use "backing beans" to tie user interface events to server side code. If we were to express the Lift example in terms of an ICEfaces application, we might put something like this in our JSF page:

<ice:outputText value="#{helloWorld.howdy}" />

Unlike in Lift, our Java bean would need to be configured with a specific lifespan (e.g. "request" or "session") and bound at application startup time using the application-wide "faces-config.xml" (or you could use Spring to instantiate your beans). Our backing bean would contain a traditional JavaBean property called "howdy" that's backed by getters and setters.


In Spring MVC or Grails, the developer would need to apply additional security checks to their MVC code using something like Spring Security to protect against common attacks. In Lift, security is baked into the framework at the sitemap level.

In other MVC frameworks, replay attacks are a common exploit that have to be especially considered when coding an application. By requesting your form, an attacker could learn what request parameters he would need to bombard your application with. In Lift, replay attacks are next to impossible because the names of request parameters are basically random. When a user requests a page with a form, for example, Lift ties request parameter names like "F2812254715K3N" to properties in your Scala object. In this case, the field is a first name field. When the user submits this form, Lift will properly set my Scala object's properties because I've "bound" the form to my internal String called "firstName". I can't submit the same values again and again to get the same result because I've already passed a value to my bound object.

ICEfaces is JSF on Ajax steroids, so it isn't as inherently susceptible to the garden variety of automated attacks as a "plain" MVC application (where a controller responds to a known, constant URL request). Like Lift, it benefits from the basic HTTP Request/Response cycle abstraction that make it easier for the developer to use. That said, ICEfaces applications don't have baked-in security like Lift and require an additional layer to protect your application.

Pattern Matching

Because it's written in Scala, Lift benefits from the daunting, but powerful Pattern Matching programming metaphor. At first glance, pattern matching seems to be an elaborate "switch" statement or simply a condensed "if/else". In my estimation, pattern matching is more like the latter than it is the former—but it's also more than either.

In Java, switch statements are frustratingly simplistic because they only allow types like "int" and "char":

enum Type {
Type t = getMyType();
switch(t) {
case ONE:
case TWO:

To even approximate pattern matching in Java, you would have to deeply interrogate an object with a series of "if/else if" statements:

MyType t = getMyType();
if(t.getType().equals("one")) {
} else if(t.getType().equals("two")) {
} else ...

This is not only fragile, but verbose and a little hard to follow. The equivalent in Scala is much cleaner:

val t:MyType = getMyType
t.getType match {
case "one" => something()
case "two" => somethingElse()

Lift (and Scala web development in general) use this pattern matching paradigm to simplify code that branches logic. Since Scala is type-safe, the pattern matching takes on new levels of functionality that are, to be honest, a little confusing and hard to really understand fully. To treat pattern matching any more fairly in this article would ballon its size two or three times! It's a big topic because it's a powerful part of Scala and Lift.

There is no Java, Ruby, or Python equivalent to Scala pattern matching.

The Big Downside

ICEfaces applications have tooling, heavyweight though it may be. IntelliJ IDEA, NetBeans, and eclipse, et al have many hundreds of lines of application code designed to help the developer create JSF and ICEfaces applications. There's a bit of a learning curve with ICEfaces, but generally speaking, a traditional J2EE developer will be able to transition to ICEfaces development without a lot of trouble. They could even mix ICEfaces and Spring MVC in the same application and use ICEfaces more as a traditional view layer than as a holistic application framework.

Lift and Scala, however, have no mature toolset in the popular IDEs—though command-line support is pretty good, all things considered. You can use Maven to build Scala/Lift projects, so most IDEs encourage Scala users to pursue building their projects with Maven. But since Scala is a compiled language, code has to be constantly re-compiled and the sophisticated parsing engines of IDEs like IntelliJ IDEA don't offer the developer as much pre-compile support as there is for other languages.

Scala also has a steep learning curve. I still feel like a n00b, even after a couple months. Though Lift is at version 2.0, going on 2.1, there aren't an over-abundance of tutorials and blog posts to help the developer new to Scala and Lift. I'm told it's worth it in the end, if you can stick with it.

Finally, The Wrap-Up

I hope I've at least piqued your interest to learn more about Non-MVC frameworks. There isn't enough time in two (or even 10) articles to really do justice to either Lift or ICEfaces. As with anything, though, you'll learn more by playing around with them than you will by anyone telling you about them. I encourage you to visit their websites, view their demos, and read through their documentation.

MVC is a tried-and-true method for deploying web applications. It's been around a long time and is not likely to go away. But Social and Web 2.0 have changed the rules of the game. It behooves us as developers to keep watching out for those technologies that help us do our jobs better or help us offer better functionality to our clients than can our competitors.

Good luck!

Further reading:

Jon Brisbin is an Architect/Analyst/Java Guru at NPC International, the world's largest Pizza Hut franchisee. He's been deploying web applications on Tomcat for over 10 years and currently focuses on cloud computing (virtual, hybrid, and private). He built a private cloud from scratch using VMware ESX, Ubuntu Linux, packing tape, and rusty baling wire. He's done consulting work with industry leaders and Mom-and-Pops alike. Prior to NPC, Jon developed new application frameworks, integrated the AS/400 with UNIX and Windows systems, developed Lotus Domino applications, hacked websites together with Perl CGI and a text editor, and served with US Air Force Intelligence in a very hot and sandy, but undisclosed, location. He lives in the rural Midwest.

He blogs on Web 2.0 (and sundry topics) on his website:



I am a web developer and I know that this field has got great scope. However, this field is an in the process of evolution. The nature of jobs here would change greatly when new technologies get introduced. So one must keep updating his knowledge. hotels catalina island


Obat Herbal Kanker Kelenjar Getah Bening
==>Obat herbal untuk terapi kelenjar getah bening dengan tanpa tindakan operasi dan dengan biaya sangat terjangkau tak menjebol dompet.

Obat Herbal Batu Empedu
==>Amazon Plus Obat Herbal Sakit Batu Empedu bagi para penderita batu empedu
Minum ekstrak kulit manggis Amazon anti radikal bebas Obat Alami Batu Empedu, Gangguan Kantung Empedu dapat sembuh oleh Obat Tradisional Amazon Plus.

Obat Herbal Batu Ginjal
==>Obat Alami Sakit Batu Ginjal Tanpa Operasi Amazon Plus
Terapi menggunakan obat herbal sakit batu ginjal Amazon herbal merupakan pengobatan yang sangat aman dan telah terbukti ampuh menyembuhkan sakit batu ginjal sampai sembuh.

easy going

thanks for sharing with that

thanks for sharing with that awesome articles thanks u a lot
rasoio elettrico | regolabarba | ferro da stiro con caldaia | Friggitrice ad Aria | scopa a vapore | ripetitore wifi | ripetitore wifi amplificatore wifi piastra a vapore | miglior aspirapolvere | skateboard elettrico | passeggino leggero | miglior smartphone | tablet per bambini hygfi502


how to hack boom beach I wrote about a similar issue, I give you the link to my site. clash of clans juwelen verdienen

100 followers Being Starter,

100 followers Being Starter, I'm sure for life trying over the internet for the purpose of content pieces that might be from assistance to everybody. Regards. buy youtube views fast

I was very pleased to uncover

I was very pleased to uncover this page. I want to to thank you for ones time just for this wonderful read!! I definitely really liked every little bit of it and I have you saved to fav to check out new information on your web site.
Mortgage Broker Calgary

This blog was... how do I say

This blog was... how do I say it? Relevant!! Finally I have found something that helped me. Kudos!
Edmonton Mortgage Broker
Life Insurance Vancouver
Life Insurance Calgary


Remaining on top of development isn't an easy task to do. Especially when it concerns social media. Even our essay writer for cheap will tell you the same. What concerns essays on social media, there are even full-time jobs for their adjustment to the type of social media.


There is no letter place to share such wonderful wallpaper for your website, it is pretty awesome for me to download new stuff for my website. Most important thing is to make a unique content for your website and i am sure at you can get the best essay assistance for improving your content and it would be pretty great to capture fresh content for your site and also to make new visitors for your new blog too.

Great post

You have written very informative article about web development trends, i like reading the content you have posted. I have gained a lot of useful information which i did not know before.
grass mats for play areas

Whoever has seen deeply into

Whoever has seen deeply into the oyster perpetual air-king there is in the fact that men are superficial. It is their preservative instinct which teaches them to be flighty, lightsome, and false. Here and there one finds a rolex submariner passionate and exaggerated adoration of "pure forms" in philosophers as well as in artists: it is not to be doubted that whoever has NEED of the cult of the superficial to that extent, breitling an unlucky dive BENEATH it. Perhaps there is designer devi kroell replica handbags children, the born artists who find the enjoyment of life only in trying to FALSIFY its image rolex datejust (as if taking wearisome revenge on it), one might guess to what degree life has disgusted them, by the extent to which they wish to see its image falsified, attenuated, ultrified, and deified,—one might reckon the homines religiosi among the artists, as their HIGHEST rank.sdcdscdsf

Sudah merupakan fakta bahwa

Sudah merupakan fakta bahwa seorang pembaca akan terpengaruh oleh isi tulisan dari sebuah halaman saat ia melihat tata letaknya. obat aborsi surabaya


Good news for web development
whatsapp web
whatsapp for iphone


This blog is very nice. Describe a material with detailed and easy to understand

paket umroh Januari
paket umroh Februari
paket umroh Maret
paket umroh April
info Biaya Umroh
info Umroh Plus Turki

Il mio compagno e voglio solo sottolineare sarò novizio per essere in grado di blog e sito di costruzione e sito- anche la costruzione e anche in realtà goduto di questo sito web. Probabilmente si desidera aumentare il vostro sito internet. Oggi basta cliccare qui In realtà hanno cose migliori. Molte grazie per quanto riguarda scoprire il vostro sito web.

Check Cashing Spring-Valley

Awesome data..! Get go and visit any diary page victimization nice lover and in addition Document was 1st a curiously important additionally sleek main recommendation across the net page diary. At now projected with this key Check Cashing Spring-Valley They can be a verified pretty tight on-line survey. Maintain acknowledge that their area unit succeed pretty tight works out. Regards quite a ton.

New frameworks and new meta

New frameworks and new meta patterns are being defined that can be a trend for the web development. Non –MVC frameworks can definitely be a great asset for the web developers that can help in developing the site in a better way. android tablet rentals

Post new comment

This question is for testing whether you are a human visitor and to prevent automated spam submissions.