
TL;DR
This paper observes that the subtyping relation in Java and similar OO languages with generics and wildcards forms a fractal pattern, complicating mental models but potentially aiding developers with better tools and understanding.
Contribution
It introduces the novel fractal perspective of the subtyping relation in Java and other OO languages with generics, enhancing understanding and tooling for developers.
Findings
Subtyping graphs become fractals after adding generics and wildcards.
This fractal shape applies to Java, C#, C++, and Scala.
The fractal model can improve IDE support and developer intuition.
Abstract
While developing their software, professional object-oriented (OO) software developers keep in their minds an image of the subtyping relation between types in their software. The goal of this paper is to present an observation about the graph of the subtyping relation in Java, namely the observation that, after the addition of generics---and of wildcards, in particular---to Java, the graph of the subtyping relation is no longer a simple directed-acyclic graph (DAG), as in pre-generics Java, but is rather a fractal. Further, this observation equally applies to other mainstream nominally-typed OO languages (such as C#, C++ and Scala) where generics and wildcards (or some other form of 'variance annotations') are standard features. Accordingly, the shape of the subtyping relation in these OO languages is more complex than a tree or a simple DAG, and indeed is also a fractal. Given the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Logic, programming, and type systems · Advanced Malware Detection Techniques
