I have a public class A. This class would be used at both client as well as server side. But at the server end it would have lesser APIs exposed (client environment specific APIs would not be present). So, I am extracting the core APIs common to both the environments into an abstract hidden super class ASuper. That is splitting A into A and ASuper.
The problem I am facing in doing this is that many of the core APIs return object of type <T extends A>. Hence, a super-class is referring its sub-class which is against principles of inheritance. I don't want to override each such API in A (due to large number of these APIs). I don't want to change methods signature to <T extends ASuper> either. Can someone help me with this?
lundi 3 août 2015
Extract core functionalities out of a class
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire