Inscrit le: 17 Avr 2016
Moyenne de points: 1,00
|Posté le: Jeu 6 Juil - 12:09 (2017) Sujet du message: Fearless Refactoring Rails Controllers
Coding an app in Rails is always fun... for the first 3 months.
After some time, small, little things show up. The tests are no longer below 1 minute. Thin controllers are not really so thin anymore. Single Responsibility Principle is more of a not-so-funny joke than something that you can apply to your Rails models.
The build is taking so long at your machine, that you've almost automated it to immediately open Twitter, gmail, FB, HackerNews because nothing else can be done during the tests.
The speed of adding features slows down. It's no longer fun to demonstrate new features to the Customer.
Your development plan for this release sounds so great. The users could be so happy with the new features. Your code could be so elegantly designed.
Is this really all you did this week?
"Can we agree that we keep controllers thin?" - the team starts to have those little arguments. The model callbacks are killing you. They started simple and now you just keep adding the conditionals.
How can we unit test if it's all coupled together?
You'd love to unit test your models and controllers, but something doesn't feel right about the endless section of mocks, stubs. User.should_receive(this), should_receive(that). It feels like repeating the code. What's the point of such tests?
How do other Rails developers deal with such problems? Rails conventions are great at the start, after that you're on your own.
This shouldn't be so hard!
What if you could have speedy and intuitive conventions even after the app grew over time?
If you had conventions, you would spend less time moving code from one place to another, hoping that you will hide it somewhere. Less time arguing in the team means more features being delivered. More features means happy customers. We want to have happy users and customers.
What if you could add features as fast as at the start?
Fearless Refactoring: Rails Controllers - the e-book
It's possible to have the same speed of delivering features over time and the "Fearless Refactoring: Rails Controllers" e-book will teach you how.
Make your application better, simply, step-by-step, under control.
I took what's best from the popular architectures, got rid of things that don't fit well with the Rails specifics and prepared recipes how to deal with a messy Rails code.
Who has time to stay on top of all the latest articles, ideas, and code samples? You need good, working, easy to change code.
This book is a step-by-step guide how to introduce a service layer in your existing Rails app. Every step is described in every detail, with code changes. All of that, so that you can safely refactor your codebase, even without a full test coverage.