Skip to content

Tutorials

Mastering CMDx Outcomes: Results, States, and Statuses

If you've ever found yourself asking "What does this service object actually return?", you're not alone. Does it return true? The record it created? A hash with errors? Or does it just raise an exception and hope someone catches it?

In my experience, inconsistent return values are the silent killers of maintainable Ruby code. That's why CMDx standardizes everything into a single, powerful concept: the Result.

Mastering CMDx Interruptions: Controlling Flow When Things Go Sideways

Business logic isn't always a straight line. Orders get cancelled. Users don't have permissions. External APIs timeout. What separates robust code from fragile code is how gracefully you handle these interruptions.

CMDx gives you three tools for this: halt methods (skip! and fail!), exception handling, and faults. Together, they form a complete system for controlling execution flow—whether you're stopping intentionally, handling errors, or propagating failures across tasks.

Mastering CMDx Fundamentals: Tasks, Context, Execution, and Chains

When I first started building CMDx, I focused obsessively on four concepts: tasks, context, execution, and chains. These aren't just implementation details—they're the mental model that makes everything else click. Once you understand how they work together, you'll write cleaner business logic and debug issues faster.

Let me walk you through each piece, building from a simple task to a fully orchestrated task.

Getting Started with CMDx: Taming Business Logic in Ruby

I've spent years wrestling with service objects. You know the pattern—create a class, throw some business logic in a call method, cross your fingers, and hope for the best. The problem? Every team member writes them differently. Every project invents its own conventions. And when something breaks at 2 AM, good luck tracing what actually happened.

That frustration led me to create CMDx.