Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

When should use Inner Class instead (normal) Class

$
0
0
I have question about this..

When we use separated class definition? when we use inner class?? What I know is one object, one class.. But sometime I want to connect/relate several object (maybe because objects have dependency each other) then I got problem because I need publicized a method to pass the value [getter method or setter method or both] (This will become vulnerable and can cause unwanted access). If I don't want to add getter or setter method then the solution I came out is using Inner Class.

Beside that I also want to know.. In my recent program, Database application, I separate GUI-Builder into a class and Database functionality into another class. And I face a problem in related these two classes(Database class need input/value from GUI and GUI need output/value to show to user).. Is this a good way of programming? or should I instead combine them into one class by put GUI-Builder Class as Inner Class in Database Class?

Thanks.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>