Modularizing different responsibilities into separate parallel hierarchies

F Ortin, M Garcia - Evaluation of Novel Approaches to Software …, 2013 - Springer
Evaluation of Novel Approaches to Software Engineering: 6th International …, 2013Springer
When tangled inheritance hierarchies lead to code duplication, the Tease Apart Inheritance"
big" refactoring is commonly used to create two parallel hierarchies, using delegation to
invoke one from the other. Under these circumstances, the root class of the refactored
hierarchy must be general enough to provide all its services to the other hierarchy, leading
to meaningless interfaces that violate the Liskov substitution principle. In order to avoid this
limitation, we propose a behavioral design pattern that allows the modularization of different …
Abstract
When tangled inheritance hierarchies lead to code duplication, the Tease Apart Inheritance "big" refactoring is commonly used to create two parallel hierarchies, using delegation to invoke one from the other. Under these circumstances, the root class of the refactored hierarchy must be general enough to provide all its services to the other hierarchy, leading to meaningless interfaces that violate the Liskov substitution principle. In order to avoid this limitation, we propose a behavioral design pattern that allows the modularization of different responsibilities in separate hierarchies that collaborate to achieve a common goal. With this design, it is possible to use the specific interface of each class in the parallel hierarchy, without needing to define all the methods provided by every class in the hierarchy, and hence not violating the Liskov substitution principle. The proposed design is type safe and avoids the use of dynamic type checking and reflection; at compile time, the type system ensures that no type error will be produced dynamically.
Springer
以上显示的是最相近的搜索结果。 查看全部搜索结果