Vidar 28 January 2009
DRY and micro frameworks

Today I started working on refactoring my admin interface for e-commerce solution (it’s really just a simple web shop). The admin interface is now a part of the view just turning everything into text fields and select boxes when you are logged in. This is a great approach if you want to have a great admin interface: it forces you to put in time there too.

Moreover, the code is now very compact, but maybe too much so. Edit, new and show actions now share code. Edit and new are identical but I remove the controls with an action/controller test. My models are also identical in that they all just have a “name” attribute and that must be unique. CRUD operations are handled by the same controller on all models. I even use the same javascript.

This has allowed me to reduce the application to very little code, but I wonder if I will need to break it up in the future. Anyway, since I reduced the code base so much I started wondering why I needed Rails at all and checked out Sinatra. It seems interesting, especially since the tests are so tightly integrated and it uses a lot less memory. Think I’ll have to rewrite an application, taking it for a spin :)

“Don’t be a Rails programmer. Be a programmer.”
— By someone I can’t remember

« Back to posts Write a new comment

Feed-icon 0 Comments

Textilized formatting

How to use the text area
_a phrase_ a phrase
*a phrase* a phrase
_*a phrase*_ a phrase
"Link":http://link.com Example link
Complete reference