<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>plarail_hangout</author_name>
  <author_url>https://blog.hatena.ne.jp/plarail_hangout/</author_url>
  <blog_title>Engineering Tech Dojo</blog_title>
  <blog_url>https://tech.fun-toy-life.com/</blog_url>
  <categories>
    <anon>JavaScript</anon>
  </categories>
  <description>JavaScriptファクトリパターン入門：クラス版と関数版を比較する GoFのFactoryパターンは「どのクラスをインスタンス化するかを呼び出し側に知らせない」設計です。 JavaScriptに持ち込むと、クラスを使わないファクトリ関数という形に自然と落ち着きます。 この記事ではGoF的なクラス版と、JavaScriptらしい関数版を比較します。 Factoryパターンとは オブジェクトの生成処理を1か所にまとめ、呼び出し側がどのクラスを使うか意識しなくてよい状態を作るパターンです。 典型的な用途： - 種別（type）に応じて異なるオブジェクトを返す - 生成ロジックが複雑で呼び出し側に…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftech.fun-toy-life.com%2Fentry%2F2026%2F07%2F04%2F204435&quot; title=&quot;JavaScriptファクトリパターン入門：クラス版と関数版を比較する - Engineering Tech Dojo&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-07-04 20:44:35</published>
  <title>JavaScriptファクトリパターン入門：クラス版と関数版を比較する</title>
  <type>rich</type>
  <url>https://tech.fun-toy-life.com/entry/2026/07/04/204435</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
