By developing object calculi in which objects are treated as primitives, the authors are able to explain both the semantics of objects and their typing rules, and also demonstrate how to develop all of the most important concepts of object-oriented programming languages: self, dynamic dispatch, classes, inheritance, protected and private methods, prototyping, subtyping, covariance and contravariance, and method specialization. An innovative and important approach to the subject for researchers and graduates.|Procedural languages are generally well understood and their formal foundations cast in the forms of various lambda-calculi. For object- oriented languages however the situation is not as clear-cut. In this book the authors propose and develop a different approach by developing object calculi in which objects are treated as primitives. Using object calculi,the authors are able to explain both the semantics of objects and their typing rules and demonstrate how to develop all of the most important concepts of object-oriented programming languages: self, dynamic dispatch, classes, inheritance, protected and private methods, prototyping, subtyping, covariance and contravariance, and method specialization. Many researchers and graduate students will find this an important development of the underpinnings of object-oriented programming.|This book develops a theory of objects as a foundation for object- oriented languages and programming. It shows how object-oriented notions may be expressed in terms of a few basic primitives, and how these can be used to design and understand object-oriented programming languages.
Prologue.- Review: Object-Oriented Features.- 1 Object Orientation.- 1.1 Objects.- 1.2 Reuse.- 1.3 Classifying Features.- 2 Class-Based Languages.- 2.1 Classes and Objects.- 2.2 Method Lookup.- 2.3 Subclasses and Inheritance.- 2.4 Subsumption and Dynamic Dispatch.- 2.5 Type Information, Lost and Found.- 2.6 Covariance, Contravariance, and Invariance.- 2.7 Method Specialization.- 2.8 Self Type Specialization.- 3 Advanced Class-Based Features.- 3.1 Object Types.- 3.2 Distinguishing Subclassing from Subtyping.- 3.3 Type Parameters.- 3.4 Subclassing without Subtyping.- 3.5 Object Protocols.- 4 Object-Based Languages.- 4.1 Objects without Classes.- 4.2 Prototypes and Clones.- 4.3 Inheritance by Embedding and by Delegation.- 4.4 Embedding.- 4.5 Delegation.- 4.6 Embedding versus Delegation.- 4.7 Dynamic Inheritance and Mode-Switching.- 4.8 Traits: From Prototypes back to Classes?.- 4.9 Types for Object-Based Languages.- 5 Modeling Object-Oriented Languages.- 5.1 Reduction to Basic Mechanisms.- 5.2 The Role of Method Update.- 5.3 The Scope of this Book.- I: Untyped and First-Order Calculi.- 6 Untyped Calculi.- 6.1 Object Primitives.- 6.2 The ?-Calculus.- 6.3 Functions as Objects.- 6.4 Fixpoints.- 6.5 Examples.- 6.6 Traits, Classes, and Inheritance.- 6.7 Interpretations of Objects.- 7 First-Order Calculi.- 7.1 Formal Systems.- 7.2 The Object Fragment.- 7.3 Standard First-Order Fragments.- 7.4 Examples.- 7.5 Some Properties of Ob1.- 7.6 First-Order Equational Theories.- 7.7 Functions and Fixpoints.- 8 Subtyping.- 8.1 Subtyping.- 8.2 Examples.- 8.3 Some Properties of Ob1.- 8.4 First-Order Equational Theories with Subtyping.- 8.5 Classes and Inheritance.- 8.6 Objects versus Records.- 8.7 Variance Annotations.- 9 Recursion.- 9.1 Recursion.- 9.2 Recursion and Subsumption.- 9.3 Some Properties of Ob1 Higher-Order Calculi.- 20 A Higher-Order Calculus.- 20.1 Syntax of Ob?
Prologue.- Review: Object-Oriented Features.- 1 Object Orientation.- 2 Class-Based Languages.- 3 Advanced Class-Based Features.- 4 Object-Based Languages.- 5 Modeling Object-Oriented Languages.- I: Untyped and First-Order Calculi.- 6 Untyped Calculi.- 7 First-Order Calculi.- 8 Subtyping.- 9 Recursion.- 10 Untyped Imperative Calculi.- 11 First-Order Imperative Calculi.- 12 A First-Order Language.- II: Second-Order Calculi.- 13 Second-Order Calculi.- 14 A Semantics.- 15 Definable Covariant Self Types.- 16 Primitive Covariant Self Types.- 17 Imperative Calculi with Self Types.- 18 Interpretations of Object Calculi.- 19 A Second-Order Language.- III: Higher-Order Calculi.- 20 A Higher-Order Calculus.- 21 A Language with Matching.- Epilogue.- APPENDIX: Rules and Proofs.- A Fragments.- A.1 Simple-Objects Fragments.- A.2 Other Typing Fragments.- A.3 Other Equational Fragments.- B Systems.- C Proofs.- C.1 Proof of the Variance Lemma from Section 13.3.- C.2 Proof of the Variance Lemma from Section 16.4.- C.3 Deriving the Rules for ?-Objects from Section 15.1.2.- C.4 Denotational Soundness of Equational Rules.- List of Figures.- List of Tables.- List of Notations.- List of Languages.
Inhaltsverzeichnis
Prologue.- Review: Object-Oriented Features.- 1 Object Orientation.- 1.1 Objects.- 1.2 Reuse.- 1.3 Classifying Features.- 2 Class-Based Languages.- 2.1 Classes and Objects.- 2.2 Method Lookup.- 2.3 Subclasses and Inheritance.- 2.4 Subsumption and Dynamic Dispatch.- 2.5 Type Information, Lost and Found.- 2.6 Covariance, Contravariance, and Invariance.- 2.7 Method Specialization.- 2.8 Self Type Specialization.- 3 Advanced Class-Based Features.- 3.1 Object Types.- 3.2 Distinguishing Subclassing from Subtyping.- 3.3 Type Parameters.- 3.4 Subclassing without Subtyping.- 3.5 Object Protocols.- 4 Object-Based Languages.- 4.1 Objects without Classes.- 4.2 Prototypes and Clones.- 4.3 Inheritance by Embedding and by Delegation.- 4.4 Embedding.- 4.5 Delegation.- 4.6 Embedding versus Delegation.- 4.7 Dynamic Inheritance and Mode-Switching.- 4.8 Traits: From Prototypes back to Classes?.- 4.9 Types for Object-Based Languages.- 5 Modeling Object-Oriented Languages.- 5.1 Reduction to Basic Mechanisms.- 5.2 The Role of Method Update.- 5.3 The Scope of this Book.- I: Untyped and First-Order Calculi.- 6 Untyped Calculi.- 6.1 Object Primitives.- 6.2 The ?-Calculus.- 6.3 Functions as Objects.- 6.4 Fixpoints.- 6.5 Examples.- 6.6 Traits, Classes, and Inheritance.- 6.7 Interpretations of Objects.- 7 First-Order Calculi.- 7.1 Formal Systems.- 7.2 The Object Fragment.- 7.3 Standard First-Order Fragments.- 7.4 Examples.- 7.5 Some Properties of Ob1.- 7.6 First-Order Equational Theories.- 7.7 Functions and Fixpoints.- 8 Subtyping.- 8.1 Subtyping.- 8.2 Examples.- 8.3 Some Properties of Ob1.- 8.4 First-Order Equational Theories with Subtyping.- 8.5 Classes and Inheritance.- 8.6 Objects versus Records.- 8.7 Variance Annotations.- 9 Recursion.- 9.1 Recursion.- 9.2 Recursion and Subsumption.- 9.3 Some Properties of Ob1 Higher-Order Calculi.- 20 A Higher-Order Calculus.- 20.1 Syntax of Ob?
Klappentext
Procedural languages are generally well understood and their formal foundations cast in the forms of various lambda-calculi. For object- oriented languages however the situation is not as clear-cut. In this book the authors propose and develop a different approach by developing object calculi in which objects are treated as primitives. Using object calculi,the authors are able to explain both the semantics of objects and their typing rules and demonstrate how to develop all of the most important concepts of object-oriented programming languages: self, dynamic dispatch, classes, inheritance, protected and private methods, prototyping, subtyping, covariance and contravariance, and method specialization. Many researchers and graduate students will find this an important development of the underpinnings of object-oriented programming.
This book develops a theory of objects as a foundation for object- oriented languages and programming. It shows how object-oriented notions may be expressed in terms of a few basic primitives, and how these can be used to design and understand object-oriented programming languages.