最終更新日:2025/12/05

(object-oriented programming) The problematic situation where a base class contains methods which mutate an object in a manner which may invalidate a (stronger) invariant found in a derived class, violating the Liskov substitution principle. For example, if a circle is modelled as a subtype of an ellipse, and the ellipse has a method that stretches it on one axis, the circle must also implement that method despite it making no sense for a circle.

音声機能が動作しない場合はこちらをご確認ください
正解を見る

circle-ellipse problem

編集履歴(0)
元となった辞書の項目

circle-ellipse problem

名詞
日本語の意味
オブジェクト指向プログラミングにおいて、基底クラスに定義されたメソッドが、派生クラスで保持される強固な不変条件を破ってしまう可能性がある設計上の問題。例えば、楕円のサブタイプとして円をモデル化した際に、楕円に備わった変形メソッドを円にも実装させる必要が生じ、円としての特性に矛盾が生じるケースを示す。
このボタンはなに?

オブジェクト指向のAPIを設計する際には、円を楕円のサブタイプとしてモデル化するという問題を避けるべきです。なぜならそれがサブクラスに強い不変条件を破るような変更を実装させてしまうからです。

Dictionary quizzes to help you remember vocabulary

編集履歴(0)

ログイン / 新規登録

 

アプリをダウンロード!
DiQt

DiQt(ディクト)

無料

★★★★★★★★★★