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.
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.