[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
Modularity in the Presence of SubclassingApril 1997
1997 Technical Report
Publisher:
  • Massachusetts Institute of Technology
  • 201 Vassar Street, W59-200 Cambridge, MA
  • United States
Published:01 April 1997
Reflects downloads up to 12 Dec 2024Bibliometrics
Skip Abstract Section
Abstract

Classes are harder to subclass than they need be. This report addresses this problem, showing how to design classes that are more modular and easier to subclass without sacrificing the extensibility that makes subclassing useful. In the context of single inheritance, we argue that specialization interfaces should be partitioned into class components. A class component groups part of a class''s state together with methods to maintain that state. Class components establish abstraction boundaries within classes, allowing modular replacement by subclasses. Replaceability requires reasoning about each component as an independent unit that depends only on the specifications of other components and not on their implementations. We discuss rules for such reasoning. In the context of multiple inheritance, we advocate the use of mixins as a replacement for class components. Instantiable classes are built by combining multiple mixins. In the mixin style of design, class hierarchies have more classes than in equivalent single-inheritance designs, but the classes have smaller, simpler interfaces and can be reused more flexibly. To explore the impact our ideas might have on program design, we consider existing libraries in light of the proposed single- and multiple-inheritance methodologies. We also consider the impact of our ideas on language design.

Cited By

  1. ACM
    Parkinson M and Bierman G Separation logic and abstraction Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, (247-258)
  2. ACM
    Parkinson M and Bierman G (2019). Separation logic and abstraction, ACM SIGPLAN Notices, 40:1, (247-258), Online publication date: 12-Jan-2005.
  3. ACM
    Banerjee A and Naumann D (2005). Ownership confinement ensures representation independence for object-oriented programs, Journal of the ACM (JACM), 52:6, (894-960), Online publication date: 1-Nov-2005.
  4. ACM
    McCamant S and Ernst M Predicting problems caused by component upgrades Proceedings of the 9th European software engineering conference held jointly with 11th ACM SIGSOFT international symposium on Foundations of software engineering, (287-296)
  5. ACM
    McCamant S and Ernst M (2003). Predicting problems caused by component upgrades, ACM SIGSOFT Software Engineering Notes, 28:5, (287-296), Online publication date: 1-Sep-2003.
  6. ACM
    Ruby C and Leavens G Safely creating correct subclasses without seeing superclass code Proceedings of the 15th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, (208-228)
  7. ACM
    Ruby C and Leavens G (2019). Safely creating correct subclasses without seeing superclass code, ACM SIGPLAN Notices, 35:10, (208-228), Online publication date: 1-Oct-2000.
  8. ACM
    Leino K Data groups Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, (144-153)
  9. ACM
    Leino K (2019). Data groups, ACM SIGPLAN Notices, 33:10, (144-153), Online publication date: 1-Oct-1998.
Contributors
  • MIT Computer Science & Artificial Intelligence Laboratory
Please enable JavaScript to view thecomments powered by Disqus.

Recommendations