News for hackers. Stuff that matters.
Re:Rails Testing with Factory Girl by mattgreenrocks on Wednesday August 22, 2012 @10:32AM (#4417499)
That's where we find ourselves currently: constructing 3-4 levels out due to Law of Demeter violations, and it becomes incredibly brittle when seemingly unrelated classes change.

IMO, DHH (and others) argue too hard against core OO principles (like SRP and LoD) that have the possibility of helping out when the domain model becomes more complex. "Just use Rails" is fine when spinning up, but as the app grows, it becomes increasingly less pleasant. Coupling increases in the name of less code.

Ideas like hexagonal architecture look nice, but I'm left wondering how to implement them when the framework insists on infecting core domain classes (AR::Base).

Re:Rails Testing with Factory Girl by deafbybeheading on Wednesday August 22, 2012 @11:18AM (#4417761)
So can someone recommend a Ruby (edit: ideally Sinatra/Sequel, not Rails) app one could look at with a more principled test suite? I'm coming from a more traditional OO background and jumping into Ruby. It's good to see I'm not alone in finding this militant pragmatism somewhat off-putting, but I don't want to reinvent the wheel.
Re:Rails Testing with Factory Girl by sanderjd on Wednesday August 22, 2012 @12:13PM (#4418091)
As an FYI to your last point - in Rails master (which will be Rails 4), you can active-record-ify a class by including ActiveRecord::Model, rather than inheriting from ActiveRecord::Base. In fact, that is all ActiveRecord::Base does itself - https://github.com/rails/rails/blob/master/activerecord/lib/....
Re:Rails Testing with Factory Girl by mattgreenrocks on Wednesday August 22, 2012 @12:49PM (#4418269)
But your core domain classes are still coupled to their persistence mechanism in the name of 'pragmatism.'
Re:Rails Testing with Factory Girl by sanderjd on Wednesday August 22, 2012 @05:25PM (#4419671)
Who says they have to be? That's a design decision. There is literally nothing (besides maybe inertia?) that enforces that "rule".