Concatinative Versus Object Oriented Design

Published on: 2011-05-03 by Anders Conbere

I finally moved my blog over to using Igor my new static blog generator. A couple of things have fallen out of this work. First is a feeling of two design forces pulling me in opposite directions. I feel torn between the simple semantics of a group of functions and a few monolithic classes. The former doesn't feel particularly pythonic, but the latter doesn't feel particularly well designed.

Having seen some fantastic application design I can tell that Igor isn't the most well designed of programs. There are functions littered in modules that they don't belong, there are classes where there doesn't need to be and no classes where there should be! And I should have seen this coming. I set out on this project with the goal of not designing up front. Instead to build a working tools and to refine it. But I've found that the result is an application that works but lacks beauty.

So let's look at some of the problems here, and some solutions I've been working on.

The primary goal of Igor is to make publishing a simple, relatively static website simple for me. I've decided to accomplish this through simple parsing of text files and some opinionated choices on directory structure. A secondary goal related to the first is to allow me to do this with as little extra effort as possible. I don't want to have to use external scripts, I don't want to type out the date to get the published date, etc. To that end I've decided to make as much use of the Operating System and VCS as possible.

So the design needs to work something like.

Given source and destination directories

  • retrieve the names of all the text files in the _posts directory below it
  • parse each of them, applying an apporpriate markup filter
  • publish each post to an appropiately named directory in the destination
[ ...Read More ]
  1. 2011-05-03 - Concatinative Versus Object Oriented Design
  2. 2011-05-03 - The Problem Finding Talent
  3. 2011-05-03 - Setup and Teardown Methods With Py.test
  4. 2011-05-03 - Igor Design Part 2
  5. 2011-05-03 - Learning to Program is Easy
  6. 2011-05-03 - Atom feeds for igor... difficult
  7. 2011-05-03 - Get XMPP - BOSH working with Ejabberd, Firefox and Strophe
  8. 2009-02-16 - Deploying wsgi applications behind Nginx
  9. 2008-08-06 - Building Ejabberd Modules - Part 4 - XMPP Bots
  10. 2008-07-31 - Building Ejabberd Modules - Part 3 - HTTP Modules

More Posts This Way ->