The problem that ViewComponent solves for me - Code with Jason
17-Mar-2022 1160
If you just stuff all your domain logic into Active Record models then the Active Record models grow too large and lose cohesion.A model loses cohesion when its contents no longer relate to the same end purpose. Maybe there are a few methods that support feature A, a few methods that support feature B, and so on. The question “what idea does this model represent?” can’t be answered. The reason the question can’t be answered is because the model doesn’t represent just one idea, it represents a heterogeneous mix of ideas.Because cohesive things are easier to understand than incohesive things, I try to organize my code into objects (and other structures) that have cohesion.
The problem that ViewComponent solves for me - Code with Jason #ruby #rubydeveloper #rubyonrails #problem #ViewComponent #solves #Jason #code https://rubyonrails.ba/link/the-problem-that-viewcomponent-solves-for-me-code-with-jason