Three solutions came into my mind :
- Make
ThisClass
singleton - in this way you will never be able to instantiate more than one class ofThisClass
type. - Create an instance of
ThisClass
type and pass it through constructor to all other classes. - Create an abstract class / interface which holds a static instance variable of type
ThisClass
, and then extend/implement this abstract class / interface in classes you want to have the sameThisClass
instance.