Putting metaclasses to work: a new dimension in object-oriented programming
暂无分享,去创建一个
(Chapters conclude with Exercises and a Summary.) Preface. Glossary of Symbols. 1. Introduction. A Fable. Dictionaries. Procedural Specifications. 2. The Elements of Reflective Class-based Models. The Set of Objects. A Class Is an Object. Structure of an Object. Methods. Inheritance. The Top of the Inheritance Hierarchy. An Initial Environment. Creating Objects. Drawing Class Structures. Metaobject Protocols. 3. Inheritance of Metaclass Constraints. Fundamental Guarantee of Object-Oriented Programming. Metaclass Incompatibility. Metaclass Constraints. Importance of Inheriting Metaclass Constraints. From the Programmer's Point of View. Epistemological Argument for Inheritance of Metaclass Constraints. On Metaclasses That Invoke Instance Methods. 4. Dynamic Aspects of Our Object Model. Method Invocation. Instance Variable Access. Instance Initialization. Conservative Merge. Method Resolution Order. Class Construction. Parent Method Call. Cooperative Override Methods. Serious Order Disagreements. A Simple Programming Model. Monotonicity of Implementation Chains. 5. DTS C++. C++ Basics. DTS C++ Basics. Graph Versus Tree Inheritance. Typechecking. 6. Our Metaobject Protocol. Interface to Our Metaobject Protocol. Object Creation. Retrieving the Class of an Object. Freeing Objects. Initializing Classes. Solving a Set of Metaclass Constraints. Defining Methods of a Class. Readying a Class. Example: a Metaclass for Managing the Extent of a Class. Invoking Methods from Interpreters. Instance Variable Access. Example: Creation Time Stamps. Redispatching a Method. 7. Cooperation among Metaclasses. Requirements for Cooperative Metaclasses. Metaclass for Cooperation. Notes on the Design of Cooperation. Conflicts and Library Design. A Discussion of Parameter Passing. A Metaclass for Redispatching All Methods. Example: A Simple Trace Facility. 8. Before/After Metaclasses. The Composition Problem. Design of the Before/After Metaclass. Discussion. Example: A Simple Metaclass for Thread Safety. 9. Proxies. The Purpose of Proxies. Design of a Proxy Metaclass. Properties of Proxies. Distributed Systems. Extent Managed Proxies. 10. Metaclasses for Frameworks. Invariant Checking. Single Instanced Property. The Abstract Property. The Final Property. Mixins. Preventing Parent Method Calls. 11. Release-to-Release Binary Compatibility. The Library Compatibility Problem. Defining Release-to-Release Binary Compatibility. Procedural Programming. Object-Oriented Programming. When Classes are First-Class Objects. A Comparison of Support in Several Object Models. Completeness of a Set of Transformations. 12. Conclusion. Contributions of This Book. Appendix A Advanced Linearization. A.1 Properties of Linearizations. A.2 The Limits of Linearization. Appendix B Handling Apply and Redispatch Stubs. B.1 Enhanced Control over Method Dispatch. B.2 Example of an Apply Stub. B.3 Example of a Redispatch Stub. Appendix C Rationale for Drawing Conventions. Appendix D Answers to Selected Exercises. Bibliography. Index.