Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
oop-concordance.rtf
Скачиваний:
6
Добавлен:
10.02.2016
Размер:
2.04 Mб
Скачать

23 Subtype polymorphism

26 Similarly, in his 2003 book, Concepts in programming languages, John C. Mitchell identifies four main features: dynamic dispatch, abstraction, subtype polymorphism, and inheritance.Michael Lee Scott in Programming Language Pragmatics considers only encapsulation, inheritance and dynamic dispatch.[16]

40 records are basis for understanding objects if function literals can be stored in fields (like in functional programming languages), but the actual calculi need be considerably more complex to incorporate essential features of OOP. Several extensions of System F<: that deal with mutable objects have been studied;[18] these allow both subtype polymorphism and parametric polymorphism (generics)

56 It is intuitive to assume that inheritance creates a semantic "is a" relationship, and thus to infer that objects instantiated from subclasses can always be safely used instead of those instantiated from the superclass. This intuition is unfortunately false in most OOP languages, in particular in all those that allow mutable objects. Subtype polymorphism as enforced by the type checker in OOP languages (with mutable objects) cannot guarantee behavioral subtyping in any context. Behavioral subtyping is undecidable in general, so it cannot be implemented by a program (compiler). Class or object hierarchies need to be carefully designed considering possible incorrect uses that cannot be detected syntactically. This issue is known as the Liskov substitution principle.

470 common subtype as its type). C++ provides an alternative, where only parents

668 violates subtype polymorphism, because only subclass polymorphism is based on

921 provided by base classes or types (subclass and subtype polymorphism,

969 On inheritance is subtype polymorphism:

981 insta nce of a superclass is required. For subtyping (subtype polymorphism),

983 in the subtype (subtype is subset of supertype). Cardelli and Wegner view

984 classes as sets of objects (resulting in subtype objects are a subset of

1004 ("bounded quantification" by C+W. C+W's parameters are subtype polymorphic

1006 acceptable and no inheritance relation is required (subtype polymorphism).

1011 [As inclusion polymorphism covers both subtype and subclass polymorphism,

1061 typed subtype polymorphism, as provided in Emerald, can be implemented

1153 Subtype Polymorphism, as opposed to Subclass Polymorphism, is the best answer

1174 satisfy the operations or type constraints of a polymorphic object (subtype

1192 similar to subtype polymorphism; however, ACs require type compatible classes

1202 [Jones 92] are all examples of OO systems providing subtype polymorphism.

1263 variables - with subtype polymorphism making up the difference.

functional

10 Objects as a formal concept in programming were introduced in the 1960s in Simula 67, a major revision of Simula I, a programming language designed for discrete event simulation, created by Ole-Johan Dahl and Kristen Nygaard of the Norwegian Computing Center in Oslo. Simula 67 was influenced by SIMSCRIPT and Hoare's proposed "record classes". Simula introduced the notion of classes and instances or objects (as well as subclasses, virtual methods, coroutines, and discrete event simulation) as part of an explicit programming paradigm. The language also used automatic garbage collection that had been invented earlier for the functional programming language Lisp. Simula was used for physical modeling, such as models to study and improve the movement of ships and their content through cargo ports. The ideas of Simula 67 influenced many later languages, including Smalltalk, derivatives of LISP (CLOS), Object Pascal, and C++.

12 In the 1970s, Kay's Smalltalk work had influenced the Lisp community to incorporate object- based techniques that were introduced to developers via the Lisp machine. Experimentation with various extensions to Lisp (like LOOPS and Flavors introducing multiple inheritance and mixins), eventually led to the Common Lisp Object System (CLOS, a part of the first standardized object-oriented programming language, ANSI Common Lisp), which integrates functional programming and object-oriented programming and allows extension via a Meta- object protocol. In the 1980s, there were a few attempts to design processor architectures that included hardware support for objects in memory but these were not successful. Examples include the Intel iAPX 432 and the Linn Smart Rekursiv.

40 records are basis for understanding objects if function literals can be stored in fields (like in functional programming languages), but the actual calculi need be considerably more complex to incorporate essential features of OOP. Several extensions of System F<: that deal with mutable objects have been studied;[18] these allow both subtype polymorphism and parametric polymorphism (generics)

80 Steve Yegge, making a roundabout comparison with Functional programming, writes, "Object Oriented Programming puts the Nouns first and foremost. Why would you go to such lengths to put one part of speech on a pedestal? Why should one kind of concept take precedence over another? It's not as if OOP has suddenly made verbs less important in the way we actually think. It's a strangely skewed perspective."

82 Carnegie-Mellon University Professor Robert Harper in March 2011 wrote: "This semester Dan Licata and I are co-teaching a new course on functional programming for first-year prospective CS majors... Object-oriented programming is eliminated entirely from the introductory curriculum, because it is both anti-modular and anti-parallel by its very nature, and hence unsuitable for a modern CS curriculum. A proposed new course on object- oriented design methodology will be offered at the sophomore level for those students who wish to study this topic."

612 See also section 1.19 below for a discussion on the functional (prefix) verses

620 imply a functional prefix notation, although the CLOS designers (who coined the

621 term "multi-method") consider the functional and receiver based forms

622 (messages) equivalent. Functional syntax was chosen "in order to minimize the

715 statement of what is needed; a coverage of both functional and quantified

763 analysis methodologies with such constructs as associations (E-R), functional

953 a value, it has many functional types and is therefore polymorphic.

971 (subclass) in languages, especially if records are allowed to have functional

1040 [The Author notes this is a functional view of polymorphism (as provided in

1134 2.6) What Is This I Hear About ML And Functional Programming Languages? (Typing - Object-Oriented Technology)

1135 ML, Metalanguage, is a functional programming language with a strongly typed

1137 recent functional language and Haskell [Hudak 92] provides a more modern and

1203 Functional languages such as ML, Russell, and Haskell provide a separation with

1233 languages. One such popular functional language is ML, in which all functions

2663 dynamic testing, including: functional testing, structural

j

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]