Separating different responsibilities into parallel hierarchies

The Tease Apart Inheritance is a big refactoring technique used to separate different responsibilities tangled along a class hierarchy. This refactorization associates two parallel hierarchies through their roots in order to use one from the other. The interface of the root class in the used hierarchy is commonly too general to be employed by the classes below in the parallel hierarchy, where a more specific behavior is needed. This paper describes a design that, using two parallel class hierarchies, allows recovering the specific interface of each corresponding class in the parallel hierarchy, improving the collaboration between both hierarchies. Although different implementations of the proposed design are discussed, the use of generics offers the robustness of static type checking and better runtime performance.

[1]  Robert W. Sebesta,et al.  Programming Language Processors in Java: Compilers and Interpreters: AND Concepts of Programming Languages , 2000 .

[2]  Erik Ernst,et al.  Higher-Order Hierarchies , 2003, ECOOP.

[3]  Juan Manuel Cueva Lovelle,et al.  Optimizing Reflective Primitives of Dynamic Languages , 2008, Int. J. Softw. Eng. Knowl. Eng..

[4]  Mads Torgersen The Expression Problem Revisited , 2004, ECOOP.

[5]  Juan Manuel Cueva Lovelle,et al.  Design Patterns for Teaching Type Checking in a Compiler Construction Course , 2007, IEEE Transactions on Education.

[6]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[7]  J. Baltasar García Pérez-Schofield,et al.  Including both static and dynamic typing in the same programming language , 2010, IET Softw..

[8]  Christopher W. Fraser,et al.  A Retargetable C Compiler: Design and Implementation , 1995 .

[9]  Francisco Ortin,et al.  Union and intersection types to support both dynamic and static typing , 2011, Inf. Process. Lett..

[10]  Jeannette M. Wing,et al.  A behavioral notion of subtyping , 1994, TOPL.

[11]  Andrew W. Appel,et al.  Modern Compiler Implementation in Java , 1997 .

[12]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[13]  B. Liskov Keynote address - data abstraction and hierarchy , 1988, OOPSLA '87.

[14]  Jim Hugunin Bringing dynamic languages to .NET with the DLR , 2007, DLS '07.

[15]  John C. Mitchell,et al.  F-bounded polymorphism for object-oriented programming , 1989, FPCA.

[16]  Martin Odersky,et al.  Pizza into Java: translating theory into practice , 1997, POPL '97.

[17]  J. Baltasar García Pérez-Schofield,et al.  Efficient virtual machine support of runtime structural reflection , 2009, Sci. Comput. Program..