Gradual Modularization for Ruby and Rails
$15.99
Minimum price
$24.99
Suggested price

Gradual Modularization for Ruby and Rails

Improve collaboration, system design, and flexibility

About the Book

For the longest time, Ruby and Rails developers had gems and engines as their main tools for creating structure to manage large-scale structures within their applications. This book is about a new tool in their toolbelt: packages.

Based on the work on packwerk by Shopify packages allow a much more fluid move to modularization then components ever did. The effects are astounding: discussions about where to draw boundaries can be far less technical and focus more on the business because the underlying technology gets out of the way.

The concept underlying this is gradual modularization, which the author expects we will see spread into other languages and frameworks over the coming years. Why? Because gradual modularization allows for a not-before seen level of approachability and flexibility to modularization work. Work that required difficult decisions that were hard to reverse changes. Those decisions are now the extreme points on a spectrum of options where the right thing for the team can be somewhere in between.

  • Share this book

  • Feedback

    You must own a copy of this Book to access the forums.

    Email the Author(s)

About the Author

Stephan Hagemann
Stephan Hagemann

Stephan leads the product infrastructure engineering team at Gusto. Gusto has quite a bit of Ruby on Rails in the software behind their offerings and provides the perfect ground for the analysis of complex applications due to "Payroll" being both a deep and very wide domain. And Gusto is a lot more than payroll.

Stephan is the author of Component-based Rails Applications in which he lays out the previous iteration of Ruby and Rails modularization based on gems and engines. He is currently working on a new book called Gradual Modularization for Ruby and Rails, which improves on his previous ideas by reducing the cost of the needed work and increasing the opportunities for benefiting from it.

Find out more about Stephan at stephanhagemann.com.

Table of Contents

  • Acknowledgments
  • 1 Introduction to Package-based Rails Applications
    • 1.1 The inescapable challenges with components
    • 1.2 Component-based Challenges
  • 2 Getting started with packaging in a Rails application
    • 2.1 Let’s get started
    • 2.2 From one to many packages
    • 2.3 Accepting the intended dependencies - explicitly adding package dependencies
    • 2.4 Removing the circular dependencies - creating rails_shims package
    • 2.5 Analyzing and removing root dependencies (almost) - Aligning app and test code
    • 2.6 Removing all dependencies from root
    • 2.7 Recapping differences and similarities to CBRA
  • 3 Gradual Modularization: A New Model for Application Composition
    • 3.1 Gradual Typing as a Role Model
    • 3.2 Commonalities of previous modularization approaches
    • 3.3 Gradularity - Modularization Game Changer
  • Notes

Authors have earned$10,321,218writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub