October CincyRb - Jim Weirich on Decoupling from Rails

Channel:Launch Scout · Length:1:15:57 · Published:2013-10-16 · Views:48381

Watch on YouTube

Summary

A Cincinnati Ruby meetup talk by Jim Weirich on decoupling application logic from Rails. He argues for separating business logic from framework and database models.

Why HN recommends it

Cited in HN debates on testing and clean architecture as a concrete example of keeping domain code separate from Rails so tests run fast.

was quite interesting, and argued a complete separation of business logic from the model code — HN, 2016

Python, Ruby & scripting languages · Software architecture & design

Subtitles (excerpt)

Wow, that's pressure. Okay, so everybody, this is Jim Wyrick. I met Jim about five, six years ago at Cart and saw your name on rake and then saw that you were going to be at cart and I said I have to be there because I want to learn Ruby. So if it were not for Jim Wick, I would not be doing Ruby. Oh wow. Me too. I was cart. Me too. Cincinnati Agile Round Table, a now defunct user group set on hiatus. Hiatus hiatus, not defunct hiatus. Soile prolonged agile. All right. Well, thank you. Thank you. Uh yeah, I'm Jim Ler. I work for Neo and uh I'm here uh let me give you a little bit of background on what I want to talk about tonight. I'm currently teaching a class with Bob CS. Um Bob is from Columbus and he used to work for a company called Object Mentor. I don't know if you've ever heard of Object Mentor or not, but Object Mentor is the company that Bob Martin or Uncle Bob started many years ago. And uh Uncle Bob has always been big on design principles and practices. and a lot of his training material uh emphasizes using patterns and doing refactoring. Bob was one of the first guys on the agile bandwagon doing TDD at in the year 2000 thereabouts and I learned a lot of my stuff from him um when he would

On Hacker News

I'm interested to hear the patterns that users of MVC frameworks like Rails and Django have adopted when "fat models" start to become unwieldy. The video "Decoupling from Rails"[1] that's linked in this article was quite interesting, and argued a complete separation of business logic from the model code, to allow the business logic to be tested (and reused) more easily. I've definitely found fat-… — theptip, 2016-11
This is a powerful technique, though I'd say it's more useful for the build pipeline than for developers running UTs while coding (since the schema can change more frequently while doing so). To provide a counterpoint though, an advantage touted by advocates of complete decoupling from the DB is that your UT suite can run in O(one minute), rather than O(ten minutes). E.g. see [VIDEO] . I'm not 10… — theptip, 2017-04
Here's a retort to that argument from the source (Uncle Bob): [LINK] DHH wrote an article with the title "test induced design damage", not sure if he coined the term. I think there's a grain of truth there; it is possible, but not necessary, to mangle your architecture to enable testability. The case that DHH was complaining about is quite interesting in itself; it was an architecture that Weiric… — theptip, 2017-03
Decoupling business logic from web frameworks might be an interesting architectural problem that could use better tooling. Here's Jim Weirich going about it manually in Rails: [VIDEO] — brudgers, 2014-05
Am I only the only one that doesn't find 'All tests in 4 minutes, all model tests in 80 seconds' very impressive? It sounds like a really long time to me. You know what could increase the speed dramatically.... decoupling. I also think decoupling phrased in the context of the Rails 2 to Rails 3 upgrade, where pretty much everything changed, makes perfect sense. Imagine just having a few wrapper c… — kentwistle, 2014-04

Related videos