Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rubyで始める関数型ドメインモデリング

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

 Rubyで始める関数型ドメインモデリング

Avatar for Shogo Takasaki

Shogo Takasaki

February 15, 2025

Other Decks in Programming

Transcript

  1. 引用: https://zenn.dev/coconala/articles/2a885527bf2f32 ◦ dry-monadsというGemを使った例 ◦ 処理のステップ1つ1つを純粋関数にする ▪ 副作用を避けるため、例外を吐かない。大 域脱出もしない。 ▪

    その代わりにResultクラス(Success / Failure)を返す ◦ そのステップを組み合わせることで、大きな処理 (ワークフロー)を作る 👈 ドメインロジックをそのまま書く