This is a proof of concept of the use of a Facade Pattern as a solution to the ever growing problem of too many object instantiations in larger rails application controllers.
It is also an exercise on the use of other service objects to better identify responsabilities inside the domain layer.
Some objectives of this exercise are:
- Instantiate only one object in controller actions (https://robots.thoughtbot.com/sandi-metz-rules-for-developers)
- Avoid creating a 'GOD' object
- Better test coverage
- Make a better separation between model-domain-presentation layers
We could avoid some repetition of code using meta-programming, but for this example I chose to keep things more obvious.
This is a work in progress. Feel free to add suggestions.