| Ole Lehrmann Madsen and Birger Mller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Proc. of ACM OOPSLA, pages 397--406, New Orleans, LA, 1989. |
.... Module systems have acquired a form of inheritance through mixin modules [DS96, AZ99, AZ02, BL92, Bra92] first class modules [Rus00] can play a role similar to objects, and recursive modules are also being investigated [CHP99] On the object side, nested classes with virtual or abstract types [MMP89, Tho97, BOW98] can model the essential properties of signatures with abstract types in ML like module systems [Mac84] In principle, this is not a new development. Class nesting has been introduced already in Simula 67 [DMN70] whereas virtual or abstract types are present in BETA [MMPN93] as ....
Ole Lehrmann Madsen and Birger Mller-Pedersen. Virtual Classes: A powerful mechanism for objectoriented programming. In Proceedings OOPSLA'89, pages 397--406, October 1989.
....with an enclosing instance of the class T; see Section 5 for more details. This rigidity re ects the static nature of Java s translation semantics for inner classes. The explicit annotation T is used in FJI to remember the static type of e 0 . By contrast, inner classes in Beta can be virtual [16], i.e. di erent constructors may be invoked depending on the run time type of the enclosing instance; for example, if Inner was declared virtual and there were a subclass Outer of the class Outer that also had an inner class Inner, then o.new Inner( might build an instance of either ....
....(or types) they can be considered a kind of dependent types. Moreover, Beta dispenses with quali ed super: superclasses are speci ed by expressions like a1.B rather than A.B, making a1 as the enclosing instance that methods in B access. Second, inner classes in Beta can be declared virtual [16]. Usually, if a subclass declares an inner class of the same name as its superclass inner class, it just hides the declaration in the super class, just like shadowing of eld declarations in Java. On the other hand, if the superclass C declares an inner class E virtual, E can be extended and ....
Ole Lehrmann Madsen and Birger Mller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Proceedings of the ACM Conference on Object Oriented Programming, Systems, Languages, and Applications (OOPSLA'89), ACM SIGPLAN Notices, volume 24, number 10, pages 397-406, New Orleans, LA, October 1989.
.... languages are presented in [13, 11] Slide 86 Type inference for simple subtyping is developed in [69, 102, 59, 74, 105, 55, 104] Slide 88 94 Class inference is developed in [101, 45, 79, 76, 4] Slide 96 ML modules are described in [67, 106] Slide 97 Approaches to genericity are discussed in [63, 49, 61, 73, 83]. Annotated Bibliography 104 Slide 98 Multi methods are presented in [53, 72, 24, 25] Slide 99 The Self language is described in [108, 26, 27, 28, 48, 3] ....
Ole Lehrmann Madsen and Birger Mller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programAnnotated Bibliography 111 ming. In Proc. OOPSLA'89, Fourth Annual Conference on Object-Oriented Programming Systems, Languages and Applications, pages 397--406. ACM, 1989.
....encodings. We show in the paper how nested types can model module concepts such as abstract types, functors, and sharing constraints. We also show how they can model object oriented concepts such as inheritance through delegation, abstract methods, self types with matching, and virtual types [MMP89, Tor98, IP99, BOW98] These encodings are all presented using the as yet experimental programming language Funnel [Ode00a, AOS 00] Nested types are formalized in a kernel type system. Deviating from long standing practice in type theory research, the type system presented here is ....
....defined. They are by themselves not strong enough to model families of classes that are specialized together. Canonical examples of this are the subject observer pattern [GHJV94] or the nodes and edges of a graph. Virtual types have been proposed as a way to express this form of polymorphism [MMP89, Tor98, IP99, BOW98] Keeping with our running example of linked lists, the setting can be explained as follows. We wish to construct linked lists of alternating elements. There are now two node types, LLX and LLY. The elem method of an LLX object returns a value of type X whereas the same ....
Ole Lehrmann Madsen and Birger Mller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Object Oriented Programming: Systems, Languages, and Applications (OOPSLA), 1989.
....graph linearization. Linearization is the low level mechanism on which the combination mechanism builds; it does not support propagation itself, but linearization together with block structure and virtual (class and method) attributes supports it. Virtual methods are well known; virtual classes [18, 24, 11] are attributes which may vary with the enclosing class, e.g. if NodeType is a virtual class attribute of the class Graph, then Graph.NodeType could be the class Node and ColoredGraph.NodeType could be the class ColoredNode. Virtual classes are similar to, but not equivalent with, type parameters ....
Ole Lehrmann Madsen and Birger Mller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Proceedings OOPSLA '89, ACM SIGPLAN Notices, pages 397--406, October 1989. Published as Proceedings OOPSLA '89, ACM SIGPLAN Notices, volume 24, number 10.
....C(e) is always an instance of T.C, regardless of the run time type of e 0 . This rigidity re ects the static nature of Java s translation semantics for inner classes. The explicit annotation T is used in FJI to remember the static type of e 0 . By contrast, inner classes in Beta are virtual [14], i.e. di erent constructors may be invoked depending on the run time type of the enclosing instance; for example, if there were a subclass Outer 0 of the class Outer that also had an inner class Inner, then o.new Inner( might build an instance of either Outer.Inner or Outer 0 .Inner, ....
....classes and procedures) There are two signi cant di erences from inner classes. First, inner classes are covariantly specialized in a subclass: for example, if C : D and both C and D have the declaration of an inner class of name E, then C.E must extend D.E. Second, nested classes are virtual [14], in the sense that it depends on run time type of the enclosing instance which constructor is invoked. A constructor invocation e.new E(e) instantiates an object of class C.E when the run time type of e is C while it instantiates an object of class D.E when that of e is D. Madsen has recently ....
Ole Lehrmann Madsen and Birger Mller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Object Oriented Programming: Systems, Languages, and Applications (OOPSLA), 1989.
....C(e) is always an instance of T.C, regardless of the run time type of e 0 . This rigidity re ects the static nature of Java s translation semantics for inner classes. The explicit annotation T is used in FJI to remember the static type of e 0 . By contrast, inner classes in Beta are virtual [13], i.e. di erent constructors may be invoked depending on the run time type of the enclosing instance; for example, if there were a subclass Outer 0 of the class Outer that also had an inner class Inner, then o.new Inner( might build an instance of either Outer.Inner or Outer 0 .Inner, ....
....classes and procedures) There are two signi cant di erences from inner classes. First, inner classes are covariantly specialized in a subclass: for example, if C : D and both C and D have the declaration of an inner class of name E, then C.E must extend D.E. Second, nested classes are virtual [13], in the sense that it depends on run time type of the enclosing instance which constructor is invoked. A constructor invocation e.new E(e) instantiates an object of class C.E when the run time type of e is C while it instantiates an object of class D.E when that of e is D. Madsen has recently ....
Ole Lehrmann Madsen and Birger Mller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Object Oriented Programming: Systems, Languages, and Applications (OOPSLA), 1989.
....the entity derived from is also a class. For this to work as a means to support genericity, classes should be able to contain partially abstract types, and subclasses should be able to complete these as part of the inheritance declaration. This kind of genericity is provided by virtual types [MMP89,Tho97,Tor98] Recent discussions have brought attention to the bene ts of either approach, most notably [BOW98] which suggests a language containing both mechanisms. Currently visiting Professor Akinori Yonezawa at University of Tokyo, Japan. Currently visiting Luca Cardelli at Microsoft ....
....this example (in particular the body of the compare method) would not be possible using simple type recursion and constrained genericity. 2.2 Virtual Types Virtual types provide an alternative means for describing generic classes. The notion of virtual types originates from the virtual patterns [MMP89] of the Beta programming language [KMMPN83,MMPN93] Recently [Tho97] provides a suggestion for how to add virtual types to Java. Building on this, BOW98] suggest combining a limited version of virtual types with parameteric polymorphism to obtain the ability to express mutually recursive ....
Ole Lehrmann Madsen and Birger Mller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Object Oriented Programming: Systems, Languages and Applications (OOPSLA). SIGPLAN, ACM Press, 1989.
....in a number of proposed extensions to Java [26, 25, 2, 3, 12, etc. An alternative approach, commonly called virtual types (or virtual classes) allows classes and objects to contain types as members, along with the usual fields and methods. 1 Virtual types were originally developed in Beta [23] and have recently been proposed for Java [33] The static typing of virtual types is not yet clearly understood. Indeed, early proposals were statically unsafe, requiring extra runtime checks; more recent work has produced several proposals for type safe variants [35, 5] These proposals vary ....
....programming. For example, a generic Bag class can be defined with a virtual type ElementType. Then classes NatBag, StringBag, etc. can be defined by inheriting from Bag and giving ElementType a final binding to Nat or String. Other examples of generic programming with virtual types can be found in [23, 33]. 3 Summary of Type System It is well understood [29, 6, etc. how parametric classes classes abstracted on type parameters can be understood as polymorphic functions in a typed lambda calculus. By analogy, objects with type members should clearly be modeled as some kind of records with type ....
[Article contains additional citation context not shown here]
Ole Lehrmann Madsen and Birger Mller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Object Oriented Programing: Systems, Languages, and Applications (OOPSLA), 1989.
....class hierarchies and is difficult to maintain during program evolution. Inference of instantiating types greatly helps in some cases but not others. The solution we propose is to use syntactic sugars, without resorting to a different semantics such as matching [Bruce et al. 97] or virtual types [Madsen M ller Pedersen 89] The remainder of this section describes these situations and our solutions. In our presentation we attempt to highlight what needs to be handled by a practical type system, in a way independent of a particular system or language. We give a verbal description and example code written in ....
....separately from their clients and to document, in a machine checkable way, the assumptions about the declarations parameters. Eiffel [Meyer 92] supports covariant overriding of methods and fields in subclasses and parameterized classes with parameters automatically considered covariant. Beta [Madsen M ller Pedersen 89, Madsen et al. 93] provides a similar mechanism with virtual types; an extension to Java with virtual types has also been proposed [Thorup 97] These languages provide very convenient notation for the situations discussed in Section 3, but give up on static checking; Beta and the extension to ....
Ole Lehrmann Madsen and Birger Møller-Pedersen. Virtual Classes: A Powerful Mechanism in Object-Oriented Programming. In Proceedings OOPSLA '89, pages 397--406, October 1989. Published as ACM SIGPLAN Notices, volume 24, number 10.
....C(e) is always an instance of T.C, regardless of the run time type of e. This rigidity reflects the static nature of Java s translation semantics for inner classes. The explicit annotation T is used in FJI to remember the static type of e. By contrast, inner classes in Beta are virtual [7], i.e. different constructors may be invoked depending on the run time type of the enclosing instance; for example, if there were a subclass Outer 0 of the class Outer that also had an inner class Inner, then o.new Inner( might build an instance of either Outer.Inner or Outer 0 .Inner, ....
Ole Lehrmann Madsen and Birger Møller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Object Oriented Programing: Systems, Languages, and Applications (OOPSLA), 1989.
.... declarations, the bound will ensure that numbers can be compared to numbers, and collections of numbers can be compared to other collections of numbers, but will disallow comparing numbers to collections of numbers, unlike covariant typing as in Eiffel [Meyer 92] or virtual types as in Beta [Madsen M ller Pederse 89, Madsen et al. 93] and Thorup s proposal for Java [Thorup 97] Additionally, different representations of numbers (such as integers and floats) can be intermixed in the collection and compared to each other; subtyping is still available after instantiating the polymorphic declarations, unlike ....
.... to be a (subtype of) Drawing, and therefore has a bitmap plot(screen, bitmap(d) method set pixel(d ViewClass[D,V] V, p Any:Position, c Any:Color) Void plot pixel(screen, p, c) Systems based on covariant method typing such as Eiffel [Meyer 92] or covariant type refinement such as Beta [Madsen M ller Pederse 89] and Thorup s proposed extension to Java allow this program, but also allow many other programs that are not type safe; these languages either insert run time typechecking or are unsafe. On the other hand, clients of our program must instantiate the various parameterized types and classes to use ....
[Article contains additional citation context not shown here]
Ole Lehrmann Madsen and Birger Møller-Pedersen. Virtual Classes: A Powerful Mechanism in Object -Oriented Programming. In Proceedings OOPSLA '89, pages 397--406, October 1989. Published as ACM SIGPLAN Notices, volume 24, number 10.
....of proposed extensions to Java [OW97, MBL97, AFM97, etc. An alternative approach, commonly called virtual types (or virtual classes) allows classes and objects to contain types as members, in addition to the usual field and method members. 1 Virtual types were originally developed in BETA [MMP89] and have recently been proposed for Java [Tho97] The static typing of virtual types is not yet clearly understood. Indeed, early proposals were statically unsafe, requiring extra runtime checks; more recent work has produced several proposals for type safe variants [Tor98, BOW98] These ....
....For example, a generic Set class can be defined with a virtual type ElementType. Then classes IntegerSet, StringSet, etc. can be defined by inheriting from Set and giving ElementType a final binding to Integer or String. Other examples of generic programming with virtual types can be found in [MMP89, Tho97]. 3 Records with Type Fields It is well known that parametric classes classes abstracted on type parameters can be understood as polymorphic functions in a typed lambda calculus. Similarly, objects with type members should clearly be modeled as some kind of records with type fields. ....
[Article contains additional citation context not shown here]
Ole Lehrmann Madsen and Birger Møller-Pedersen. Virtual classes: A powerful mechanism in objectoriented programming. In Object Oriented Programing: Systems, Languages, and Applications (OOPSLA) , 1989.
....is the inverse of inheritance. The loss of an explicit class hierarchy may at first seem to cause severe problems, since some programming mechanisms depend on exactly this. In particular, we think about redefinition of method bodies in subclasses, and about the constructs super [25] and inner [33, 37]. However, these mechanisms depend primarily on the existence of multiple implementations of methods. This we can certainly handle, since a label contains a sequence of implementations of methods several of which may have the same name. The dynamic behavior of a message send is to search the ....
Ole Lehrmann Madsen and Birger Møller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Proc. OOPSLA'89, Fourth Annual Conference on Object-Oriented Programming Systems, Languages and Applications, pages 397--406. ACM, 1989.
....means that in recordlist the recursive occurrence of list is implicitly substituted by recordlist. But why, we ask, should only the class in some but not all new expressions be substitutable By introducing class lookup, we remove this unpleasing asymmetry. The notion of virtual class in Beta [9, 10] is actually implemented by a variation of class lookup. Let us now move on to a description of how to implement classes, inheritance, and instance creation. 3 Code Reuse We will describe interpreters for three languages of increasing complexity. The first involves only classes and objects, and ....
Ole Lehrmann Madsen and Birger Møller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Proc. OOPSLA'89, Fourth Annual Conference on Object-Oriented Programming Systems, Languages and Applications, pages 397--406. ACM, 1989.
....Prefixing Polymorphism Figure 2: Polymorphism and prefixing. a class ring, then specializing it to a class matrix, and finally specializing matrix to a class booleanmatrix. Another approach to generic classes is the use of modifiable declarations, exemplified by the Simula [11] and Beta [19, 14] notion of virtual attributes. This technique allows types to be modified in a subclass, thus providing substitution of type annotations in a generic class as a subclassing mechanism. Unfortunately, individual conflicting modifications may yield type incorrect subclasses; this leads to a fair ....
Ole Lehrmann Madsen and Birger MøllerPedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Proc. OOPSLA '89, Fourth Annual Conference on ObjectOriented Programming Systems, Languages and Applications, pages 397--406. ACM, 1989.
No context found.
Ole Lehrmann Madsen and Birger Mller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Proc. of ACM OOPSLA, pages 397--406, New Orleans, LA, 1989.
No context found.
Ole Lehrmann Madsen and Birger Moller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In OOPSLA '89 Proceedings, pages 397--406, 1989.
No context found.
Ole Lehrmann Madsen and Birger Mller-Pedersen. Virtual Classes: A Powerful Mechanism in Object-Oriented Programming. In Proceedings OOPSLA '89, pages 397--406, October 1989. Published as ACM SIGPLAN Notices, volume 24, number 10.
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC