Call Montréal, Canada 524-949-6869

Blog

Tuesday, May 7, 2013

Ron Jeffries on Requirements

This is one of my favourite quotes on requirements:

Most of us were taught to write down all our requirements at the very beginning of the project. There are only three things wrong with this: “requirements,” “the very beginning,” and “all.” At the very beginning, we know less about our project than we’ll ever know again. This is the worst possible moment to be making firm decisions about what we “require.”

From Estimation is Evil, Ron Jeffries: Signatory of the Manifesto for Agile Software Development 

Friday, April 26, 2013

Recently Launched: Tarkett Sports CMS and Websites

An ongoing project I have been working on at Dynamo over the last year with Hugo Frappier is a custom CMS for Tarkett Sports, a division of the Tarkett Group, "a worldwide leader of innovative and sustainable flooring and sports surface solutions".

A multi-Site, multi-lingual CMS

Tarkett Sports required a multi-site, multi-lingual CMS to serve all the sites of their subdivisions. FieldTurf (North America) was the first to be launched on the new platform, followed by FieldTurf Europe and an API for their iPad sales tool, "Link". At the time of writing, Beynon Sports Surfaces and Tarkett Sports Indoor (North America) are set to launch within the month.

Built on Ruby on Rails and MongoDB

The CMS was built with the usual Rails stack, however MongoDB was used with Mongoid, an Object-Document-Mapper, instead of ActiveRecord and a relational database. This was my first venture in the world of NoSQL, and working with a schema less data store was a perfect match for the CMS. However, it did require a new way of thinking, such as being comfortable with de-normalizing data structures and ensuring those data structures can be properly index. For example, MongoDB does not allow indexing of parallel arrays.

Support a large content-base

Why a custom CMS? Why didn't we just use one of the prominent offerings such as RefineryCMS? I've implemented five RefineryCMS installations over the last couple of years, and Refinery's sweet spot is small websites. Tarkett Sports currently holds over 10,000 content items. Refinery's UI and tree data structure is just not appropriate for such a large content-base.

Publish content collections anywhere in the page hierarchy

We also took a novel approach to the page hierarchy. With platforms such as RefineryCMS and Radiant, structured content (think news and product catalog) containing large data sets are typically supported by creating custom Rails model view, and controller classes. There's usually wrangling to unify the site URLs with the routing system. The Tarkett Sports CMS supports the concept of a collection. A collection of structured content, small or large, can be published anywhere within the page hierarchy. No URL wrangling required, no custom controller class. Collections are a first class citizen.

Reduce custom classes, increase content type re-use

The benefit of all this is that it has reduced the number of custom classes required for a site by increasing the reuse of existing collections and content types. In the past, I have found myself creating custom controllers and models just to support a different content type with the same structure just so I can use it in a different part of the page hierarchy. The concept of publishable collections has solved this.

Below are a few screen shots, showcasing the different sites and portions of the administration screens.

FieldTurf (North America) Home Page

FieldTurf (North America) Home Page

FieldTurf (Europe) Home Page

FieldTurf (Europe) Home Page

FieldTurf Products

FieldTurf Products

FieldTurf Product Detail

FieldTurf Product Detail

Tarkett Sports CMS Admin: Pages

Admin Pages

Tarkett Sports CMS Admin: Page Detail

Admin Page Detail

Tarkett CMS Sports Admin: Page Publishing

Admin Page Publishing

Monday, April 22, 2013

Open Gems with vim-bundler

When working with platforms such as Spree and RefineryCMS it's more than likely that I will be extending their models more often that not. This means opening the Gem to identify a specific behaviour I want to override. Vim is my text editor of choice, and I typically try to restrict my self to one instance of the editor running. It makes working with multiple buffers a lot easier! Whenever I want to open a Ruby Gem, it always irks me that I have to open another instance of the editor, in a separate window/pane (although Tmux reduces the pain of this a wee bit).

Vim does offer a client-server option, but admittedly I couldn't get this working and in my search I came across Tim Pope's vim-bundler. From the README:

An internalized version of bundle open : :Bopen (and :Bsplit , :Btabedit , etc.).

Exactly what I wanted, a way to `bundle open` within Vim. Here's a quick demo of using vim-bundler to open Spree's `Order` model and navigate to the `add_variant` method.

vim-bundler from Nicholas Henry on Vimeo.

Tuesday, April 9, 2013

Taming the pile of unread books

Recently I posted to Facebook:

You know you have a book buying problem when... you discover that you have two copies of the same book on your bookshelf. Unread.

Yes, I have a book buying problem. And after that post I decided it was time to do something about it. I love reading. I find it extremely motivating and inspiring. But having a few dozen unread or partially started books is not only a waste of money, but just another open loop in my life that just doesn't need to be there. Jumping from book to book also inhibits in my ability to really understanding a book.

And before you start thinking I'm talking about a pile of trashy romance novels, I am talking about computer and business related books!

So how did it get this way?

I have always had a stack of unread books around, but I typically got through the queue. However, with eBooks it really has got out of control. I start with reading an inspiring blog post, or watching a video of a conference talk, it references a book and wham! Next moment, I'm online purchasing that sucker.

So what have I done to resolve this?

It was pretty simple really. I present to you, my three step plan:

  1. First, I took inventory. I identified the books as unopened, "briefly" started (read a few chapters), and "well" started (at least half way through).
  2. For those that were briefly started, I removed bookmarks, virtual or physical, and added them to the unopened pile. Basically, calling bankruptcy on the "briefly" started. This cleared a lot of open loops. A lot.
  3. With the "well" started books I recorded them in OmniFocus. This has helped me to keep conscious of how many books I have on the go. This ended up being four in total. The goal is to have no more than two in progress.

Since starting this two weeks ago, I have completed one book, and will finish the second this week. I will be at my goal of two in progress. Oh, and I haven't bought any new books in the last two weeks -- there have been a couple of occasions where I would have.

Book Queue in OmniFocus

Yes, I know this all sounds pretty ridiculous. However, I bet I'm not the only developer out there, with a book addiction. If you are, please let me know in the comments, how you have curbed your book buying behaviour, or please give my recovery plan a go!

Friday, November 30, 2012

Have you tried ctags with Vim?

After reading Mislav Marohnić's excellent post on Vim, I decided to add ctags to my development environment. What does it buy you? It allows you to jump to method or class definitions with these commands:

<C-]> / :tag foo # jump to tag under cursor/named
g<C-]> / :tjump foo # choose from a list of matching tags

Setup is pretty easy:

brew install ctags

You can generate tags with:

ctags -R --languages=ruby --exclude=.git

But you probably won't want to do all that manually. As Mislav points out in his post, Tim Pope shows us how to automate tag generation with git hooks.

I've been using ctags this afternoon and already it has turned Vim into a completely different editor for me.

Monday, November 12, 2012

Using Google Site Search for Content Sites: Things to Keep in Mind

I've used Google Site Search for a couple of unstructured content sites (opposed to applications or structured content such as catalogs) and pretty happy with it, but there a certainly some things you should be aware of before committing to this service:

  • The service's crawler works the same on Google.com. This means, it will only index publicly available pages that it can access. So you cannot use it on password-protected staging sites.
  • If you consider removing the password from the staging site you won't want to do that either, as your site must be registered with Google Webmaster tools, so your staging site will eventually end up in the Google.com index. But there's also another issue.
  • Indexes to URL's contain the domain of your site, so you can't index your staging site, then hope to use that index in your live site.

If you're re-launching an existing site -- your only option is to enable search after you have made that site publicly available via the production domain. If it's a new site, and you have the option, make the site publicly available a couple of days before hand and index the site. Google Site Search provides on-demand indexing, updating the index within 24 hours.

When indexing the site, you have three options for supplying URL's:

  • Individual URL's only
  • URL's linked from a specific page or Sitemap
  • URL's in a Sitemap only

Again, you must have your site registered with Google Webmaster Tools for the indexing to work.

For more information on indexing checkout Custom Search Help documentation.

Friday, October 26, 2012

Domain Patterns are Alexandrian Patterns

It's been a while since I have posted on this blog. So just to let you know that I'm still alive, this is what has been keeping me occupied. It's best summed up by a quote from the book Object Thinking by David West. This is a must read for any Rails developer who is following the object-oriented Rails culture.

Patterns most useful to object thinkers should be derived from the problem domain, just as objects are. They should facilitate thinking about co-ordination and scripting of objects or about useful ways of assembling objects into components or applications. They could be considered Alexandrian patterns. Few of the patterns (about 6 of the 23) presented in the GoF book satisfy this demand. Martin Fowler’s book on Analysis Patterns presents examples derived from a domain and is much closer to Alexander’s intent than the GoF book.

My intent is to post more on Domain Patterns in a Rails context in the near future. We'll see.

Developing Ruby on Rails applications and Radiant-based Content Management Systems in Montréal. Contact Firsthand.