Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Presenter and Decorators are design approaches that can be used in Rails applications outside of the standard Models, Views and Controllers. These approaches are becoming more and more popular as teams search for new ways to identify and manage the complexity within their applications. In this session Mike Moore will defined the Presenter and Decorator approaches using simple and clear terminology. Common design problems in Rails applications will be shown using real-life code examples and refactored toward Presenters and Decorators. Code will be improved and strengthened by identifying and respecting the dependencies within large applications.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the session titled "Presenters and Decorators: A Code Tour," Mike Moore explores the concepts of Presenters and Decorators as design patterns in Rails applications, emphasizing their role outside the traditional Models, Views, and Controllers framework. Moore starts by sharing his personal nervousness and excitement about discussing topics he is passionate about, particularly the pain points developers face with complex Rails applications. He highlights that Presenters can alleviate these issues but should only be employed when necessary due to potential overhead. Key points discussed include: - **Definition and Purpose of Presenters**: Presenters are advanced constructs aimed at easing pain in complex Rails applications. They should not be considered until a significant pain point is recognized within the application structure. - **Real-Life Example of Complexity**: Moore illustrates the complexity developers may encounter when trying to understand and modify code that employs advanced concepts like components. He uses a recent experience at work to stress the difficulties new developers face within complex paraphernalia. - **Advantages of Using Presenters**: Moore details how an Author Summary Presenter can encapsulate logic that enhances the organization of a template, separating presentation logic from business logic effectively, thus allowing templates to be simplified and easier to understand. - **Decorators**: He briefly introduces theDecorator pattern, explaining its flexibility in enhancing functionality without altering the original objects or models. Libraries like Draper and Active Decorator can facilitate the implementation of this pattern. - **Serialization Challenges**: The presenter discusses how serialization of objects can be cumbersome and presents the solution of creating a separate Serializer class, which can be unit tested separately from the view logic. - **Presenter Spectrum**: Moore suggests understanding the spectrum of presenters, where they may lie closer to model or view, depending on their complexity and role. - **Real-world Applicability**: Throughout the talk, Moore emphasizes that while presenters can enhance maintainability and organization, they also introduce dependencies that developers must be aware of. He shares a framework of rules regarding when to deploy presenters, based on project pain points. In conclusion, Moore encourages viewers not to rush into using Presenters but to recognize when their implementation can lead to cleaner, more maintainable code. He reiterates that the presenter pattern is about simplifying views by delegating responsibilities to specific objects, thus promoting a clearer separation of concerns within the codebase. The talk blends theoretical knowledge with practical insights, aiming to improve developers' experience in Rails application development.
Suggest modifications
Cancel