PHP to Ruby Rewrite :: Week One

by George on September 13, 2008

Well, we’re at the end of week one and I feel like we’ve made some decent progress on the big rewrite project. We spent some time going through the data design of the old application in order to get a lot of that back in our heads and sketched out on paper. We also spent some time learning a little more about Ruby and Rails in general, plus some specific things such as ActiveRecord. We also spent time installing and getting our environment set up like we want it. Finally, we started creating our Rails models.

The existing database was fairly well designed, but it does not use any kind of data modeling framework. I had created my own data access layer which essentially amounts to a set of function libraries for every type of data access and manipulation needed. These functions go beyond simple data access though; quite a bit of business logic (and even *gasp* some view logic) has crept in over time. When faced with restrictions from the CMS I was working in, it was just too easy to hack out something that would work. Because to fix things the right way meant, well, a big rewrite. So we decided to make a few modifications to the database design to make it  fit better with Rails ActiveRecord style development. On paper, our new design has 21 models so far.

It’s now the end of the week. We’ve learned a lot. (Like Matz said at the Lone Star Ruby Conf last weekend, the best way to learn is just to get in there and start working with it.) Our environments are (mostly) set up like we need. We’ve designed out our data models on paper. It was important to me to follow a BDD process using rspec and autotest from the beginning, so we’ve got those things set up and working as well. We created a Rails app, decided we needed to change a few things, scrapped it and started again. We have half a dozen models in the newest attempt and (almost) have those all talking to each other how they need to. I can’t wait to see how far we can get next week.

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>