Skip to main content

Your Server-Side Form Library

If it isn't already obvious from my previous posts, I've been spending a lot of time on the client side of things with JavaScript and the Dojo toolkit.
I had a chance last weekend to show off a little bit of Dojo and once I got past the lightweight technique for bootstrapping it from the server, my demonstration suddenly got a lot less glamorous.

I think part of it got lost amidst what resembled gruelling swing form code.  I was lucky in that I already had some completed forms to show off, so it was possible to show the kind of experiences you can deliver when you use a good client-side framework.

There was however a takeaway for me which after a lot of thinking, I think I've managed to figure out...

It's Holding you Back!

Your server side form library is killing your UX, coupling your model to the view and tying down your options client-side.

I've worked with forms in Symfony 1.4 extensively and have become quite adept at bending them to whatever need may arise.  I've played with the form library in Symfony 2.0 and am also familiar with what Rails has to offer.
Anyone who has spent time working with the forms of their server framework has probably puzzled over the best approach to a number of problems.  Each time, spending most of the time making sure that all the gears line up.

Why not take that time and spend it instead on making better forms featuring a superior UX and decoupled, unobtrusive architecture?

It's not all bad

Server side form libraries do offer useful features in the way of data binding and validation.  These are abstractions that I think any framework should focus on perfecting as they help ensure that you're committing good data.
Where things start going wrong is when you become reliant on generating your forms and then depending on progressive enhancement to make it pop.  The issue being that you've lost control of your implementation:
  • Your markup is decided for you unless you pour hours into writing a renderer.
  • The form will likely have to be included as part of a full page render.
  • Your front end is now fully coupled with the server.
Really, at the end of the day, the best job you should want to do server-side is make sure bad data doesn't get in.  So when it comes to designing client-side interactions, why not target the client first and the server second instead of the other way around?

After all, the internet is always getting better - do you really want to have to worry about whether your server framework supports every new technology that comes around?

My Original Problem

People who like using server side form libraries tend to turn their nose up at something like Dojo because it's alluring to be able to write a model and have everything thereafter generated.  The problem however is that this architecture has everything pointing the wrong way.

Generating forms server side can also have implications when it comes time to iterate after getting your first round of client feedback.  How many times have you had a client look at a form and want it to be more?  If you've ever designed a form beyond a simple RFI, you know full well that there is going to be extra work!


This is an opinion that I've been slowly working my way towards, but I'm more and more convinced that time spent on server side forms can be - for a comparable investment of time - put to better use creating exclusively client side forms with the likes of Dojo, GWT or YUI.

As someone who has spent time mastering Symfony 1.4's forms inside & out, I think it's entirely conceivable that you can get better results doing things this way.  Factor in the time spent wiring together (and troubleshooting/maintaining!) progressive enhancements, and I'm sure you'll at the very least break even.

Popular posts from this blog

Amazon in Winnipeg?

Late last week, Amazon put word out that they're starting to look for a city to locate a second headquarters.  The fuel this announcement provides has the hype train in Winnipeg going so fast, it's missing stops.

I'm curious though.  As you've been digesting this exciting news, who have you spoken or listened to?
Was it this guy and his party's historic theft of public infrastructure (pdf) and incompetence with digital strategy? Or how about this guy, who maintains that Winnipeg doesn't need a proper rapid transit option?  You know, the kind that might actually catch the eye of handsome Amazon who now has Winnipeg trying to be the belle of the ball.

Runner up articles are Winnipeg's inability to join the 21st centry on active transport and the compounding of the aforementioned digital strategy mistakes.
Stop Listening to These Guys They are not technology experts. At worst, they're unabashed self promoters. At best they're conduits for very bad pol…

The Cons, Winnipeg's New Splash Pads

I never had the chance to be ungrateful, the new splash pad at Kildare and Wabasha isn't a splash pad at all.  It was taken away from us and replaced with an "aquatic park", a little bit of wordsmithing designed to gloss over the fact that an open piece of our community has been replaced with yet another closed gate.

As I write this post now, I can hear it already: "Taken away, what?! It's a new water park, you're so..."
Sure, some might reach for that tired recrimination, which is why I started this blog post by dismissing such a premise.  To be fair however, I offer the response: Don't spoil this discussion with nonsense.
You see, I was grateful before the renovations happened.  The communal service on offer was adequate and I never complained about it or saw it as flawed.  Don't believe me? Here, this is a cute google-generated animation of my son enjoying the splash pad in 2014.

Today we took the kids to see if we could spend some time at th…

Winnipeg Devs! Let's get WPL to carry O'Reilly Safari!

Short and sweet. I discovered the other day that the Toronto Public Library actually gives members access to O'Reilly Safari -- I was instantly jealous! You probably already know that this is a pretty good service chock-a-block full of great resources.

The good news is that we have a way to request new content from the Winnipeg Public Library.  This includes digital content, so I've done exactly that!
If you're interested in adding your voice to mine, I've put together a letter that you need to copy/paste and enter into their simple form. Here's a copy that you can read as part of this post:

This is a request for ongoing and full access to the complete O'Reilly Safari catalogue via a Winnipeg Public Library card. I am filing this under "Magazine Purchase" as it's not a single book, but an ongoing service. Following is a list of the most prominent benefits of adding this service to the collection:
O'Reilly produces extremely high quality conten…