Patterns to deal with big ActiveRecord models
updated over 4 years ago; latest suggestion about 4 years ago
“Skinny controllers, fat models” is a well-known practice in the Rails community that everyone seems to follow. However, as your application evolves and your models grow, maintaining them can become less enjoyable than it used to be.
In the last few years, the community has been proposing patterns and techniques to deal with big AR models. Presenters, Service objects, Concerns or DCI are only a few examples of solutions suggested to alleviate the pain caused by gigantic models.
In this talk, we will critically explore these patterns in their varied flavours. We'll compare them in order to expose their strengths and weaknesses and you'll learn when and how to use them to keep your Rails models as pleasurable to deal with as the first day.
This sounds very interesting and has the potential to give a lot of things to take away. Would it be possible to combine it with your other ActiveRecord proposal and maybe give a simple example, (with code?), of one of the patterns you'll present?
I'm interested to hear more about how you will "critically explore" the patterns, given the time available - any chance of a brief outline of the talk?
I think it doesn't go against the anonymous policy to say that I'm the author of these three proposals (which are variations on the same subject):
- Sustainable productivity: Rails vs OOP
- Keep your ActiveRecord models manageable the Rails way
- Patterns to deal with big ActiveRecord models
During the last six months I've been researching about the big-models issue in Rails. There's a fair amount of buzz in the community about how to deal with this problem and I though it would be interesting to study in depth each different view.
In this talk in particular, I'd present and compare both the patterns that are part of the so-called Golden Path (Rails way) and those that deviates from it.
It sounds to me like this talk would be very similar to this other one about ActiveRecord models and the rails way. Could you elaborate a bit more on how they might be different? If you'd like, we can put you in touch with the proposer of that talk so you can discuss and maybe even turn these talks into a double-header.