<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tanakahisateru</author_name>
  <author_url>https://blog.hatena.ne.jp/tanakahisateru/</author_url>
  <blog_title>なんたらノート第三期ベータ</blog_title>
  <blog_url>https://tanakahisateru.hatenablog.jp/</blog_url>
  <categories>
    <anon>PHP</anon>
    <anon>Scala</anon>
  </categories>
  <description>PHP5.4にはトレイトという文法が導入されて、多重継承の便利さが享受できるようになるそうです。 いろいろ試してみることにしました。トレイトといえば代表選手はScalaですね。Scalaでいうトレイトは、インターフェースの定義とメソッドの実装を同時にやってくれる便利な概念でした。単一継承のOOP言語では「〜は〜の一種」という制約が強すぎて、「ペンギンは鳥の飛行メソッドによって飛行できてしまう」という問題があります。でもちゃんと「ペンギンは飛べないが泳げる鳥」を綺麗に解決する必要はあって、その解答として、トレイトのあるScalaではこんな解が導けます。 abstract class Animal…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftanakahisateru.hatenablog.jp%2Fentry%2F20110704%2F1309781929&quot; title=&quot;PHP5.4とScalaのトレイト比較 - なんたらノート第三期ベータ&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>2011-07-04 21:18:49</published>
  <title>PHP5.4とScalaのトレイト比較</title>
  <type>rich</type>
  <url>https://tanakahisateru.hatenablog.jp/entry/20110704/1309781929</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
