<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>shaw27</author_name>
  <author_url>https://blog.hatena.ne.jp/shaw27/</author_url>
  <blog_title>はてはてな</blog_title>
  <blog_url>https://shaw27.hatenadiary.org/</blog_url>
  <categories>
    <anon>JAVA</anon>
    <anon>読書</anon>
  </categories>
  <description>うー、すすまん･･･1日1項目ですか･･･ ○項目14 継承よりコンポジションを選ぶ 不適切な継承はカプセル化を壊す →その壊し具合についても例が書いてあるんだけど、わかったようで言葉で上手く説明できない。例をそのまま書くのもアレなので省略。んでヘタに継承するぐらいならコンポジション使いましょうよ、という話 既存クラスのインスタンスを参照するprivateなフィールドを持たせる --既存のクラスを新しいクラスのコンポーネントとして使う（コンポジション）ことで、それぞれの頑強性を壊さずに済む --必要に応じて新しいクラスは既存のクラスのインスタンスの適切なメソッドを呼び出して結果を返す（転送）す…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fshaw27.hatenadiary.org%2Fentry%2F20060721%2F1153434146&quot; title=&quot;Effective Java（項目14） - はてはてな&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>2006-07-21 07:22:26</published>
  <title>Effective Java（項目14）</title>
  <type>rich</type>
  <url>https://shaw27.hatenadiary.org/entry/20060721/1153434146</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
