- View components are the next generation of view layer that provide object-oriented features like inheritance and encapsulation, making views more testable and maintainable compared to traditional view helpers.
- "Cells" are a type of view component that function as a small MVC stack within a view, keeping presentation logic separate from views. They are well-suited for layouts, generic views, widgets, and other cases with complex view logic.
- Using cells/view components can avoid issues like duplicated views and file structure maintenance when dealing with reusable UI components across many views. Defining a base component logic and partials allows inheritance and customization to reduce maintenance costs.
5. Disadvantages of helpers
? do not allow inheritance
? methods are calling without a receiver
? collision between helpers with similar methods
6. We can replace helpers to
decorators and improve
presentation logic
7. Advantages of decorators
? allow inheritance
? allow encapsulation
? friendly for unit testing
? does not mutate decorated object
? does not change the behavior of decorated object