I have a class which needs some functionality to be encapsulated in some way.
I was thinking of a nested class, and put that functionality plus some states into it.
The relation between these two classes is one-to-one.
The problem it for accessing the outer class member variables or methods they should be declared static and I don’t want it. Another solution is passing a reference of the outer class to inner class.
What’s the best practice for my problem ?
Then it works like this:
But I’m not sure if this is a good idea or not ?!