Bird Stream

Entrepreneurship, development and (sometimes) cycling, often simultaneously, mainly in Nottingham

Decoupling the Domain From the Interface With ReST and Method Objects

MVC (model-view-controller) is a well established pattern for developing web applications which I’ve used with both Rails and ASP.NET. Both of these frameworks provide powerful interface add-ons, for example validations, with which you can decorate your models and let the framework do a lot of heavy lifting for you.

However, I’ve found that using these can lead to a leaky coupling between domain and UI logic which slowly and inexorably adds complexity and maintainability headaches.

I’ve started using a new approach that I’m finding more flexible but has enough pragmatism to leverage the framework hooks and features.

My Two-penneth on the 2012 Budget

The most disappointing announcement for me was that Nottingham has missed out on it’s bid for the Super Connected Cities fund. It’s a real shame for the city. There was an additional, smaller, fund announced so hopefully the bid team can dust themselves off and we can go again.

Much was made the day before the budget about discounted lending for small businesses, ie those with less than £50m turnover. This is an amendment to the existing Enterprise Finance Guarantee Scheme where the government underwrites this lending, protecting the banks.

Spork Not Reloading Classes

Have been caught out by this for a while with a Rails app that suddenly stopped seeing code changes to classes as I was redeveloping.. Not being able to test with spork running really slowed down my development cycle. Thankfully someone found a fix.

Replace this line in test.rb

config.cache_classes = true

with this

config.cache_classes = !(ENV['DRB'] == 'true')

and development is back to full speed.

More info here http://www.avenue80.com/tiny-tip-spork-not-reloading-classes/

API Divining With Cucumber and Firefox

I’ve been discovering the wonders of RSpec and Cucumber recently (I know, I know, I’m horribly late to that particular party) and revelling in how the BDD > TDD cycle helps keep one focused on the feature being delivered.

Rest APIs are a common topic of conversation among the Esendex dev team and it was a conversation with @jbjon and @samwessel this week that inspired an experiment.

Add Filters to Views Using Named Scopes in Rails

This really helped me deliver a rather lovely solution to filtering records on Bunch Rides.

http://www.idolhands.com/ruby-on-rails/guides-tips-and-tutorials/add-filters-…

and here’s what I did: http://rides.bunch.cc/clubs/54

and the helper code:

def table_filter(filters, selected_scope)
  content_tag(:div,
    raw(filters.collect { |filter| 
      content_tag(:a, filter[:label], :href => "?show=#{filter[:scope]}", :class => ('selected' if filter[:scope] == selected_scope)) }),  
    :class => 'table-filter')
end

My Interview on the Entrepreneur Show

I was lucky enough to be interviewed by @robwilmot on his Entrepreneur Show yesterday. It was a great opportunity to share my views on how Nottingham is going to harness some of the current successes in the creative and technology scene to really cement is position as a leading centre for the UK.

The Big M Went Bold and Got It So Right

I was at the Big M mobile conference (http://thebigm.mobi/) on Monday and am very glad I was. Chris (@bookmeister) and Mike (@m1ke_ellis) made some bold decisions in putting on this event and they paid off.

Bold Decision #1 - Bath

Tech innovation and Somerset are not necessarily two words I would associate but they absolutely showed the rest of the country what a great scene exists there. Nottingham (where I live and work) could learn a lot. It is a beautiful city that is a joy to visit. In the battle for talent that cities are (or should be) engaged in now, they have served Bath well.

Bold Decision #2 - No WiFi

Didn’t miss it, in fact I’m glad it wasn’t there. The mobile signal was good enough to get emails if anything urgent cropped up. I would imagine this was one of the reasons why people talked to each other more and probably got more out of the speakers. I go to too many conferences these days where people are too busy, surfing, and interacting with people that aren’t there rather than engaging with the speakers.

Bold Decision #3 - Price

£200 for a one day conference seemed reasonably pricey and pitching this right would have been a really hand wringer but it was spot on. It meant everyone who came really wanted to get something out of it and I’m guessing it meant they could afford the calibre of speakers that they attracted.

Bold Decision #4 - Comedy/Rock Club Venue

Forget anonymous hotels or convention facilities, more events like this should be held in this kind of venue. Komedia (http://www.komedia.co.uk/) had all the facilities and looked fantastic. People arrived and there was a palpable buzz as they went through the door into the venue proper. Going to a gig for ‘work’, brilliant. It was especially entertaining watching as a bunch of geeks spilled out on to streets at the breaks, blinking as they readjusted to a bright and very real world still existing outside.


If they run it next year I will absolutely be going as should you.