[rspec-users] RSpec makes me want to write better code

Matt Wynne matt at mattwynne.net
Sat Sep 27 04:17:45 EDT 2008

On 26 Sep 2008, at 17:28, Mark Wilden wrote:

> On Fri, Sep 26, 2008 at 8:28 AM, Ashley Moran  
> <ashley.moran at patchspace.co.uk> wrote:
> One downside to STI is it forces you to leave NULL columns for  
> attributes that don't exist in all models.  This is also really bad  
> for integrity.
> I think all of your comments make sense, but I did just want to  
> call out that "the Rails way" is not typically concerned with this  
> sort of integrity at the database level. It's handled in the model.

I wouldn't call this the 'rails way' particularly - I think it's more  
of a general OO design philosophy that says the database is just an  
implementation detail. I have gradually moved, over the years, from  
feeling like the database needed to be the foundation of my whole  
domain (and therefore have tight integrity rules etc) to wishing it  
would just go away and stop bothering me. I like the way ORMs let me  
work in code most of my day rather than having to drop into the  
database to find out what the rules are.


In case you wondered: The opinions expressed in this email are my own  
and do not necessarily reflect the views of any former, current or  
future employers of mine.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080927/6fd4aaaf/attachment.html>

More information about the rspec-users mailing list