I have a question regarding OOP design in Java:
say I want to leverage a java library, which has Abstract class I and class A and B, A and B both extend I.
However, instead of using the library directly, I want to do some modifications of a concrete method f
inside class I for my customized use case. After my modification, I would like A and B's f method both to use my new customized implementation instead of the original implementation.
I don't want to modify code in place of the original library (that means I have to create a forked repo and maintain that), what is the best design/abstraction/inheritance strategy I can use to achieve this modification?
Aucun commentaire:
Enregistrer un commentaire