0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Interface とは規格

Posted at

背景

かつて私はプログラミングにおける Interface の概念の理解に苦戦していましたが、Interface は規格だと考えるようになってから理解が捗ったので、同様に苦悩している人に向けて記事を書きました。
この記事が Interface 理解の一助になれば幸いです。

説明

「インターフェイス pc」で画像検索すると様々な端子や挿し込み口(プラグ)が表示されますが、それがまさに Interface です。
クラス定義に Interface が列挙されている様子はドッキングステーションに似ています。
image.png
31464822_s.png

規格のメリット

例えば友人の家に置かれた謎の機械。そこに HDMI IN と書かれたプラグがあるとします。
謎の機械だとしてもHDMIプラグによって、あらゆるHDMIケーブルが使え、あらゆるHDMI出力端末の映像を受け取れると分かります。
またHDMIは映像の伝達用なので、入力側も出力側もデータを奪われるなどの心配は無用になります。1
規格のおかげで役割と互換性と信頼性を素早く把握できるのです。

  1. 規格違反した悪質な機械もあるので注意が必要です

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?