Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
A lightning talk from the Helvetic Ruby 2023 conference. Ideas on how ruby can help you protect your architecture. I'll work through an example of tightly coupled classes where it's not apparent who calls who and who should be allowed to call who. This is refactored in a few steps towards a design where the ruby interpreter and the packwerk gem prevent certain errors alltogether.
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 lightning talk entitled "Sliced Ruby - Enforcing module boundaries with private_const and packwerk," Severin Ráz discusses effective strategies for modularizing applications in Ruby, particularly transitioning from chaotic codebases to more organized structures. The talk emphasizes the importance of maintaining clear module boundaries to prevent unintended coupling between classes and components. Key points discussed include: - **Significance of Modularization**: Ráz highlights the common pitfall where developers end up with a 'big ball of mud' in their applications and emphasizes the importance of modularizing code to avoid this chaos. - **Tools for Enforcing Boundaries**: Two main tools are introduced for module management: `private_constant`, a built-in Ruby feature, and Packwerk, a gem designed to help enforce module boundaries and usage permissions. - **Using `private_constant`**: Ráz illustrates `private_constant` through an example featuring a `Taxes` module. He explains how making the `TaxDetails` class private prevents external classes from accessing it directly, thereby enforcing proper usage via the public `Apply` class. This redesign helps prevent tight coupling and eases maintenance. - **Introduction to Packwerk**: The talk transitions to Packwerk, which helps define and verify module interactions within the application. Ráz explains how Packwerk allows developers to specify which modules can communicate, enhancing the architecture's clarity and maintainability. It also supports a layered architecture approach, where rules about communication between layers can be effectively enforced. - **Continuous Improvement with Packwerk**: Ráz discusses how Packwerk can be integrated into continuous integration (CI) setups, providing ongoing verification of module violations through alerts and checklists. This allows teams to address issues incrementally, facilitating a smoother transition to better modular practices. - **Additional Tools and Visualizers**: The talk concludes with Ráz mentioning the additional functionalities Packwerk offers, including visualization tools to generate diagrams of module structures for better understanding. In summary, the main takeaways from the talk are the importance of modularization in Ruby applications and the effective use of tools like `private_constant` and Packwerk to enforce module boundaries. Ráz encourages developers to embrace these tools to build robust and maintainable modularized monoliths, inviting attendees to engage further at their booth.
Suggest modifications
Cancel