[rspec-users] Associations should be private

Ashley Moran ashley.moran at patchspace.co.uk
Wed Oct 1 21:22:49 EDT 2008


On Oct 01, 2008, at 8:17 pm, Mark Wilden wrote:

> Sounds like future-proofing to me. In the case of libraries, that  
> can be a good thing. For application code, it flies in the face of  
> YAGNI.

Actually I don't think that's a YAGNI.  You need *an* interface to  
your models, the question is whether to build one that litters  
trainwrecks through your code, or one that is internally refactorable.

Or, you could "take the first Demeter bullet" and use associations  
until they cause a breakage...


> The whole convention over configuration means that the underlying  
> structure tends to be exposed more than good software engineering  
> practice would advise, but it works because most of the time the  
> cost to fix a change is actually lower in Ruby than the cost of  
> preventing the change.

... which takes advantage of this property of Ruby.

> "Embrace change" - Kent Beck. The whole white book is predicated on  
> what you just pointed out about Rails.


You meant to say Ruby there, right? ;o)

Ashley

-- 
http://www.patchspace.co.uk/
http://aviewfromafar.net/



More information about the rspec-users mailing list