<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>takamizawa46</author_name>
  <author_url>https://blog.hatena.ne.jp/takamizawa46/</author_url>
  <blog_title>やわらかテック</blog_title>
  <blog_url>https://www.okb-shelf.work/</blog_url>
  <categories>
    <anon>開発所感</anon>
    <anon>Ruby</anon>
    <anon>Rails</anon>
  </categories>
  <description>みなさんはRailsの開発にて、サービスクラス(ServiceObject)を使っているでしょうか。 モデルやコントローラーがファットになるのを防ぐために導入される設計方法で、ドメイン知識におけるサービス(eg: 商品の購入処理)の一連の処理をまとめたクラスを作成することで、可用性が高くテストがしやすいコードを書くことが可能です。 techracho.bpsinc.jp 特にRailsではActiveRecordの便利さゆえにコントローラーやモデルに処理をゴリゴリと書いてしまいがち。しかし、何も考えずにサービスクラスを無秩序に作ってしまうと逆に保守性が悪い状態になってしまいます。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.okb-shelf.work%2Fentry%2Fservice_class_design&quot; title=&quot;mastdonからServiceクラスの作り方を学ぶ - やわらかテック&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/t/takamizawa46/20230323/20230323190909.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-03-28 09:30:25</published>
  <title>mastdonからServiceクラスの作り方を学ぶ</title>
  <type>rich</type>
  <url>https://www.okb-shelf.work/entry/service_class_design</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
