Telephone +44(0)1524 64544
Email: info@shadowcat.co.uk

Plat-forms Redux

Alarms, excursions, apologia and conclusions

Wed Jan 26 04:00:00 2011

Digg! submit to reddit Delicious RSS Feed Readers

I spent the better part of last week (two full days there, four including traveling time) in Nuernberg, Germany at the plat-forms contest.

Before I go on, I'd like to take the traditional moment to thank the organisers for putting together such a fascinating event and also my team mates on the Shadowcat team, Robert Sedlacek (phaylon) and Florian Ragwitz (rafl) both for being crazy enough to join me and for making the development process damn good fun.

The short version? Technologically and architecturally we did very well, deliverable wise I think we came up badly short - largely due to my own miscalculations.

First miscalculation - we had a team of three who were largely back end developers. Second miscalculation - while I attempted the traditional team lead's role of doing the parts nobody else wanted to, notably a lot of the HTML generation and controller/routing code, I underestimated how much I'd be slowed down by breaking off to scaffold DBIx::Class code and answer questions from my team mates so didn't get nearly as much of the front end written as I'd thought I would.

Third, more subtle, miscalculation - I recently cut my caffeine intake substantially and underestimated how much more reliant I now am on eating regularly in order to maintain effective focus. This showed noticeably on the second day when we started at 8am and breakfast didn't make an appearance until 10am. I don't think I was really at full speed until close to 11 and with a 6pm deadline that didn't help at all.

Apologia complete, I should talk a little about the challenge itself.

The task we were set was called "Conferences and People" and was a multi-conference attendance tracking system where organisers could create conference entries with description, location and dates and putative attendees could search for conferences and subsequently mark their intended attendance thereof.

Notable more-than-just-CRUD features were a friendship type system where attendees were required to request permission to see other attendees' full details, and a lat/long co-ordinate based search for nearby conferences and people.

We successfully completed a full backend for both of these features, the former with some relatively simple DBIx::Class code (which I wrote and probably shouldn't have done) and the latter using postgresql's postgis functionality accessed through DBIx::Class' support for literal SQL fragments in the WHERE clause (my gratitude to rafl here who already knew how postgis worked and was able to make installation and use thereof relatively painless for the rest of us).

For the front end code, we of course used the Catalyst framework, which performed admirably as always - Chained routing to snap together controller code in easily re-usable and composable segments and the excellent Catalyst::Controller::REST to handle the API backend.

Forms were handled by HTML::FormHandler (or, from my point of view, by a black box process known as "phaylon" :) which permitted rapid scaffolding of the necessary classes, and display HTML generation by HTML::Zoom, which while still not as thoroughly documented as I might prefer bent to our whims nicely over the course of development.

Database eployment for testing was simple to script up using SQL::Translator via DBIx::Class::Schema's deploy method - had we had multiple revisions we would likely have moved to DBIx::Class::DeploymentHandler but for a simple wipe and rebuild there was no real need. We used Frew Schmidt's rather nifty DBIx::Class::Candy to pretty up our result class definitions and while a minor change in theory, in practice even your somewhat old school author found not typing PACKAGE all the time quite a pleasant experience, so look for similar functionality in core at some point.

Where did the tools lack? Well, much though my experimental Reaction project was in many ways hopelessly overengineered, I found myself strongly missing its ability to produce general listview plus editing UI in a way that's easy to customise as you go. I'm unsure as to exactly what I would like in the same vein yet but HTML::Zoom seems like it should make the rendering part of the puzzle much easier to achieve - and perhaps a parameterized controller role or two would make a good start towards the logic side. CatalystX::SimpleLogin held its own nicely and was easy to customise where we needed to so I think that's well worth considering as a conceptual template.

I'm also tempted to say that DBIx::Class' flexibility wasn't an advantage everywhere - given a greenfield database design it strikes me that foreign key columns could be generated and named automatically (albeit presumably with pluggable conventions since not everyone has the same taste in naming as I do) but there was a fair bit of what felt like manual unrolling of naming conventions into code.

I think though that the most important thing we could have had was a pre-pack set of standard HTML with CSS - plat-forms were originally intending to provide a set of example files to work from but didn't have time, and the ability to have an app somewhat pretty from the get go would have been nice. Our HTML in the end was nicely semantic so far as it went but all the careful tag choice and class naming in the world doesn't look good without some CSS, and none of us were really any good at it so it didn't get written at all.

For those of you to whom this was already obvious, I think that the extent to which the conference opened my eyes to this was perhaps my most valuable lesson learned. Shadowcat's clients almost always have existing teams which include UI/UX/design people and want us to focus on business logic, architecture, scalability and deployment tooling - so being brought face to face with the fact that three well known and substantially experienced perl hackers and CPAN contributors couldn't scrape together a simple theme between us was really quite eye opening.

Overall? We could have done better, we could have done worse, I learned if anything more than I expected to - and most of all it was damn good fun and I wouldn't have missed it for the world.

Thanks once again to the organisers and if I can't make it next time? I think the other perl hackers who turned up felt much the same so we'll be there for some value of "we" and we hope you'll be happy to have us.

-- mst, out.