<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yoshiki_utakata</author_name>
  <author_url>https://blog.hatena.ne.jp/yoshiki_utakata/</author_url>
  <blog_title>猫でもわかるWeb開発・プログラミング</blog_title>
  <blog_url>https://www.utakata.work/</blog_url>
  <categories>
    <anon>PHP</anon>
    <anon>ドメイン駆動設計（DDD）</anon>
    <anon>プログラミング・開発</anon>
    <anon>本・読書</anon>
  </categories>
  <description>値オブジェクトを使わず、プリミティブな型を使うとどうなるか 各IDの型が分かりづらい delete メソッドの引数の型チェックが弱い そこで値オブジェクト さいごに 値オブジェクトを使わず、プリミティブな型を使うとどうなるか ブログシステムを考えましょう。 ユーザーがいて、ユーザIDで区別する 記事があって、記事IDで区別するとします 両方とも int だとします。 &lt;?php $userId = 1234; $articleId = 5678; ArticleRepository があり、ブログ記事を削除する場合、こんな感じになります。 &lt;?php class ArticleReposito…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.utakata.work%2Fentry%2Fphp-ddd%2Fvalueobject&quot; title=&quot;PHPでボトムアップDDD: 値オブジェクト / ValueObject - 猫でもわかるWeb開発・プログラミング&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://m.media-amazon.com/images/I/51E+hPktiQL._SL500_.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-06-07 07:00:00</published>
  <title>PHPでボトムアップDDD: 値オブジェクト / ValueObject</title>
  <type>rich</type>
  <url>https://www.utakata.work/entry/php-ddd/valueobject</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
