Rails Engines vs Packwerk: When to Use What

This is an adapted excerpt from Chapter 16 of Modular Rails: Architecture for the Long Game , my book on building maintainable Ruby on Rails applications using Rails Engines. Rails engines are not the only way to introduce structure into a monolith. Packwerk, plain Ruby gems, namespaces, and even Hanami slices offer different trade-offs. The question is not which tool is “best” – it is which tool…