I have class A with its inner class defined A1 and class B with its inner class defined B1. Do you think it is alright that class A in its implementation refers to B1 and class B refers to A1. Is it not a bad programming style? Its just A1 is very A specific class and B1 very B specific, that's why I coupled them. Is it Ok to leave it like that or its better to have A1 and B1 as separate classes? What do you think? Thx.
I believe that if you need to refer to inner classes of another class, in one of your classes, it is because possibly the class which holds the inner class should be providing some methods to avoid this problem.
If the problem is not like that, then the inner class is probably generic enough to be of use in both other classes, and as such should be an independant class, which should be probably part of the same package which specifies its context of application/use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With