Visible to the public Delegation vs Inheritance for Typestate AnalysisConflict Detection Enabled

TitleDelegation vs Inheritance for Typestate Analysis
Publication TypeConference Paper
Year of Publication2015
AuthorsDu Li, Alex Potanin, Jonathan Aldrich
Conference NameEuropean Conference on Object-Oriented Programming, Formal Techniques for Java-like Programs track
Date Published07/2015
Conference LocationPrague, Czech Republic
KeywordsCMU, July'15

For several decades, inheritance and delegation have been widely adopted for code reuse in object-oriented languages. Though extensive research has explored the expressiveness of these techniques, little is known about how the choice between them affects formal reasoning. In this paper, we explore this question by describing two core languages that are identical except for the use of inheritance and delegation, respectively. We add support for formal reasoning about typestate to both languages, and evaluate the complexity of the formal semantics and compare the example specifications. Our study suggests that our variant of delegation can substantially simplify typestate reasoning, while inheritance makes code more succinct in the case where open recursion is used.

Citation Keynode-24910

Other available formats:

Li_Delegation_JA.pdfPDF document219.94 KBDownloadPreview