Elektrine lite

← Feed

@caleb@dice.camp

2023-02-03 20:16 UTC

📝 The Decree Design Pattern I’ve been using this pattern of naming and structuring service objects over the past ~year. It’s initially been greeted with skepticism when I introduce it, but it tends to grow on folks as they give it a shot and look at how it’s already been used. I wrote this to codify some of how I’ve been explaining it to folks ad-hoc, but also to share with the broader community and get input on this way of extracting processes in Ruby/Rails projects. https://calebhearth.com/m/decree

Replies (1)

  • @esparta@ruby.social 2023-02-03 20:38

    @caleb@dice.camp just yesterday I was listening to the Bike Shed podcast, and they were talking about exactly that pattern: https://www.bikeshed.fm/358 I've been working with that pattern for a while, and it's good, the testing/mocking area is perfectly aligned and testable. When is time to integrate multiple Decrees I tend to propose evolve that pattern to include the Do-notation and we are going great at this point. Some other very similar is what TrailBrazer framework does with their Operations.

    Open ##5051839