lundi 13 mai 2019

How to cut down boiler plate code in composite/decorate pattern

In composite/decorate patter, the outer container overrides some methods to change the behavior, but have to delegate to sub-component for the rest methods. ex: class A has 10 methods, class B contains A but only override 2 methods, then B has to override 8 methods just to delegate to instance of A inside. How to cut those boilerplate code in Java and Python?

Aucun commentaire:

Enregistrer un commentaire