Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: does MovieController perfect? #2

Open
SamMolokanov opened this issue Mar 7, 2017 · 0 comments
Open

Question: does MovieController perfect? #2

SamMolokanov opened this issue Mar 7, 2017 · 0 comments

Comments

@SamMolokanov
Copy link

SamMolokanov commented Mar 7, 2017

Hi there! First of all thanks for the blog post and this example of code!

I have some doubts about the MoviesController

  • In fact, controller deals with multiple objects: Movie, Movies::Creator, Movies::Updater and Movies::Presenter. It feels like breaking Rails naming conventions. Usually we would expect that MoviesController deals with Movie.

  • Luckly, methods Movies::Creator#execute and Movies::Presenter#execute accepts the same parameters as Movie#update_attributes, but it is not clear why this happened. Problem that I see here - we need to change multiple classes if we will change Movie model, for example add new attribute "studio".

  • Every object in the MoviesController has specific public interface (it is clean to understand until we don't have many other controllers with their own specific objects).

In general this code style looks like breaking of standard Rails "conventions over configurations", that brings all the power of fast development. May be it would be better not to use Rails at all? There are some other frameworks that offers similar way to organize a code base, for example Hanami

PS. Sorry for posting this as Issue, but I did not found comments on the blog page :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant