Freitag, Oktober 31, 2008

legacy databases with datamapper

For my current project I choose datamapper wich has some advantages over ActiveRecord. I need a thread safe ORM which doesnt need to do much but performing real fast. I am dealing with legacy table names but couldnt find any documentation how this is done though its very simple:

Your model needs a method storage_name like :

def self.storage_name(repository)

Repository can be ignored if you are just dealing with one database.

ps: afcool83 mentioned a smarter way to do this:


Mittwoch, Oktober 15, 2008

the power of testing

I really thought we are over this point yet but it turns out to be a mistake. I work in a couple of projects in parallel so I meet a lot of developers and see many different types. I am really surprised to realize that the need to write tests still is so much underestimated.

All the classics like "no time to write tests", "is it really worth the effort" to "I thought this is just a webapp, so there is no need to write tests".

It happend to often too me, so here is my lesson learned if you start a new project with existing code. Ask for the tests. Take a peek a their test code, it gives you far more insight then any arbitrary code. It doesnt mean dont take any projects where no tests have been written, but it gives you different arguments. Its like dealing with legacy code, you cannot start implementing features as everything is fine.
But if the project leaders dont realize this fact forget the project, its a death march.

To say it with Obie Fernandez words
"Delivering Rails applications without automated test coverage is irresponsible and unprofessional."