The problem that ViewComponent solves for me - Code with Jason

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 #code https://rubyonrails.ba/single/the-problem-that-viewcomponent-solves-for-me-code-with-jason

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles