skip to main content
10.1145/2633301.2633307acmotherconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

Why inheritance anomaly is not worth solving

Published: 28 July 2014 Publication History

Abstract

Modern computers improve their predecessors with additional parallelism but require concurrent software to exploit it. Object-orientation is instrumental in simplifying sequential programming, however, in a concurrent setting, programmers adding new methods in a subclass typically have to modify the code of the superclass, which inhibits reuse, a problem known as inheritance anomaly. There have been much efforts by researchers in the last two decades to solve the problem by deriving anomaly-free languages. Yet, these proposals have not ended up as practical solutions, thus one may ask why.
In this article, we investigate from a theoretical perspective if a solution of the problem would introduce extra code complexity. We model object behavior as a regular language, and show that freedom from inheritance anomaly necessitates a language where ensuring Liskov-Wing substitutability becomes a language containment problem, which in our modeling is PSPACE hard. This indicates that we cannot expect programmers to manually ensure that subtyping holds in an anomaly-free language. Anomaly freedom thus predictably leads to software bugs and we doubt the value of providing it.
From the practical perspective, the problem is already solved. Inheritance anomaly is part of the general fragile base class problem of object-oriented programming, that arises due to code coupling in implementation inheritance. In modern software practice, the fragile base class problem is circumvented by interface abstraction to avoid implementation inheritance, and opting for composition as means for reuse. We discuss concurrent programming issues with composition for reuse.

References

[1]
C. Atkinson. Object-Oriented Reuse, Concurrency and Distribution: An Ada-Based Approach. Addison-Wesley, 1991.
[2]
L. Bergmans and M. Aksit. Composing synchronization and real-time constraints. Journal of Parallel and Distributed Computing, 36(1): 32--52, July 1996.
[3]
L. Bergmans, B. Tekinerdogan, M. Glandrup, and M. Aksit. Composing software from multiple concerns: A model and composition anomalies. In Proc. ICSE 2000 (2nd) Workshop on Multidimensional Separation of Concerns, 2000.
[4]
D. Caromel, L. Mateu, G. Pothier, and E. Tanter. Parallel object monitors. Concurr. Comput.: Pract. Exper., 20(12): 1387--1417, 2008.
[5]
W. Cook and J. Palsberg. A denotational semantics of inheritance and its correctness. In Meyrowitz {28}, pages 433--443.
[6]
L. Crnogorac, A. S. Rao, and K. Ramamohanarao. Classifying inheritance mechanisms in concurrent object oriented programming. In 12th ECOOP, pages 571--600. Springer, 1998.
[7]
G. Cugola and C. Ghezzi. CJava: Introducing concurrent objects in Java. In 4th OOIS, pages 504--514. Springer, 1997.
[8]
S. Ferenczi. Guarded methods vs. inheritance anomaly: Inheritance anomaly solved by nested guarded method calls. SIGPLAN Notices, 30(2): 49--58, Feb. 1995.
[9]
C. Flanagan and S. Qadeer. A type and effect system for atomicity. In PLDI '03, pages 338--349. ACM, 2003.
[10]
S. Frølund. Coordinating Distributed Objects: An Actor-Based Approach to Synchronization. MIT Press, 1996.
[11]
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison Wesley Longman, 1994.
[12]
N. Giacaman and O. Sinnen. Parallel iterator for parallelizing object-oriented applications. International Journal of Parallel Programming, 39: 232--269, 2011.
[13]
B. Goetz, T. Peierls, J. Bloch, J. Bowbeer, D. Lea, and D. Holmes. Java Concurrency in Practice. Addison-Wesley, 2005.
[14]
P. Grogono and B. Shearing. Concurrent software engineering: preparing for paradigm shift. In C3S2E '08, pages 99--108, 2008.
[15]
D. Harel. On visual formalisms. Comm. ACM, 31(5): 514--530, May 1988.
[16]
M. Herlihy. A methodology for implementing highly concurrent data objects. ACM Trans. Prog. Lang. Sys., 15(5): 745--770, 1993.
[17]
D. Holmes. Java: Concurrency, synchronization and inheritance. http://www.mri.mq.edu.au/~dholmes/java-concurrency.html, accessed 1998, 1998.
[18]
A. Holub. Why extends is evil. JavaWorld, Aug. 2003. http://www.javaworld.com/article/2073649/core-java/why-extends-is-evil.html.
[19]
J. E. Hopcroft. On the equivalence and containment problems for context-free languages. Mathematical Systems Theory, 3 (2): 119--124, 1969.
[20]
D. G. Kafura and K. H. Lee. Inheritance in actor based concurrent object-oriented languages. Comput. J., 32(4): 297--304, 1989.
[21]
S. D. Kent. A programming language for software components. PhD thesis, Queensland University of Technology, 2010.
[22]
B. H. Liskov and J. M. Wing. A behavioral notion of subtyping. ACM Trans. Prog. Lang. Sys., 16(6): 1811--1841, Nov. 1994.
[23]
C. V. Lopes and G. Kiczales. D: A language framework for distributed programming. Technical Report SPL97-010, P9710047, Xerox PARC, Feb. 1997.
[24]
Y. Lu, J. Potter, and J. Xue. Ownership types for object synchronisation. In 10th APLAS, pages 18--33, 2012.
[25]
S. Matsuoka and A. Yonezawa. Analysis of inheritance anomaly in object-oriented concurrent programming languages. In Research directions in concurrent object-oriented programming, pages 107--150. MIT Press, 1993.
[26]
C. McHale, B. Walsh, S. Baker, and A. Donnelly. Scheduling predicates. In 5th ECOOP Workshop, volume 612 of LNCS, pages 177--193. Springer, 1992.
[27]
B. Meyer. Object-Oriented Software Construction. Prentice Hall PTR, 2nd edition, 1996.
[28]
N. Meyrowitz, editor. Proceedings of OOPSLA '89, October 1--6, 1989, New Orleans, Louisiana, USA, Oct. 1989. ACM.
[29]
L. Mikhajlov and E. Sekerinski. The fragile base class problem and its solution. Technical Report TUCS-TR-117, 1997.
[30]
G. Milicia and V. Sassone. Jeeg: temporal constraints for the synchronization of concurrent objects. Concurrency - Practice and Experience, 17(5--6): 539--572, 2005.
[31]
S. E. Mitchell and A. J. Wellings. Synchronisation, concurrent object-oriented programming and the inheritance anomaly. Computer Languages, 22(1): 15--26, Apr. 1996.
[32]
B. Morandi, S. Nanz, and B. Meyer. Record-replay debugging for concurrent scoop programs. Technical Report arXiv:1111.1170v1, ETHZ, Nov. 2011.
[33]
C. Neusius. Synchronizing actions. In 5th ECOOP, volume 512 of LNCS, pages 118--132. Springer, 1991.
[34]
M. Papathomas. Concurrency in Object-Oriented Programming Languages, pages 31--68. Prentice Hall, 1995.
[35]
M. Pradel and T. R. Gross. Automatic testing of sequential and concurrent substitutability. In 35th ICSE, pages 282--291. IEEE / ACM, 2013.
[36]
A. Ricci, M. Viroli, and G. Piancastelli. simpA: an agent-oriented approach for programming concurrent applications on top of Java. Sci. Comput. Prog., 76(1): 37--62, 2011.
[37]
A. E. Santosa, Y. Kawata, and M. Maekawa. A solution to inheritance anomaly based on reusable behavior definitions. In 10th PDCS, pages 586--589. IASTED/ACTA Press, 1998.
[38]
O. Shacham, N. Bronson, A. Aiken, M. Sagiv, M. Vechev, and E. Yahav. Testing atomicity of composed concurrent operations. In OOPSLA '11, pages 51--64, 2011.
[39]
O. Shalev and N. Shavit. Split-ordered lists: Lock-free extensible hash tables. J. ACM, 53(3): 379--405, 2006.
[40]
R. E. Strom and S. Yemini. Typestate: A programming language concept for enhancing software reliability. IEEE Trans. Softw. Eng., 12(1): 157--171, 1986.
[41]
L. Thomas. Inheritance anomaly in true concurrent object oriented languages: A proposal. In TENCON '94, volume 2, pages 541--545. IEEE, 1995.
[42]
C. Tomlinson and V. Singh. Inheritance and synchronization with enabled-sets. In Meyrowitz {28}, pages 103--112.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
ICOOOLPS '14: Proceedings of the 9th International Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems PLE
July 2014
42 pages
ISBN:9781450329149
DOI:10.1145/2633301
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

  • Uppsala University, Department of Information Science: Uppsala University, Department of Information Science
  • AITO: Assoc Internationale por les Technologies Objects

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 28 July 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. concurrent programming
  2. inheritance anomaly
  3. object-oriented programming

Qualifiers

  • Research-article

Conference

ECOOP '14
Sponsor:
  • Uppsala University, Department of Information Science
  • AITO

Acceptance Rates

Overall Acceptance Rate 11 of 14 submissions, 79%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 125
    Total Downloads
  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 24 Jan 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media