Adv TPL - SUNIL DAS THOTA ID# 2347946 Integrating Nominal...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: SUNIL DAS THOTA ID# 2347946 Integrating Nominal and Structural Subtyping ABSTRACT: In nominal subtyping, types declared in a certain way may be subtypes of each other, and in Structural subtyping, in which the structure of two types determines whether or not one is a subtype of the other. The class-based object-oriented subtyping described above is nominal; a structural subtyping rule for an object-oriented language might say that if objects of type A can handle all of the messages that objects of type B can handle (that is, if they define all the same methods), then A is a subtype of B regardless of whether either inherits from the other. Nominal and structural subtyping each have their own strengths and weaknesses. Nominal subtyping allows programmers to explicitly express design intent, and, when types are associated with run time tags, enables run- time type tests and external method dispatch. On the other hand, structural subtyping is flexible and compositional, allowing unanticipated reuse. To date, nearly all object- oriented languages fully support one subtyping paradigm or the other. In this paper, a core calculus for a language that integrates the key aspects of nominal and structural subtyping in a unified framework is described. Also, the flexibility of structural subtyping SUNIL DAS THOTA ID# 2347946 with statically typechecked external methods are merged, making a novel combination. Type safety for the language is proved and its practical utility through examples is illustrated, that are not easily expressed in other languages. The work provides a clean foundation for the design of future languages that enjoy the benefits of both nominal and structural subtyping. INTRODUCTION: The subtyping can be broadly classified into two types: Structural Subytping(also called intrinsic) Nominal Subtyping(also called declarative According to Structural subtyping, a type U is a subtype of T, if its methods and fields are a superset of Ts methods and fields. The interface of a class contains public fields and methods and there is no need to declare a separate interface type which is unlike Nominal Subtyping where in a type U would be a subtype of T if and only it is declared to be. ADVANTAGES OF STRUCTURAL SUBTYPING: Structural subtyping is Expressive, since in structural subytping, the relationships need not be defined in advance. SUNIL DAS THOTA ID# 2347946 Programmers need not plan for all the scenarios....
View Full Document

Page1 / 13

Adv TPL - SUNIL DAS THOTA ID# 2347946 Integrating Nominal...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online