R
Rv5
I have a good programming practice question. Just for fun, Ive taken on a
side project that will help a teacher friend of mine work out grades. I
want a GUI interface that will store and retrieve grading info. So Im
hoping someonecan walk me through my class structure. My biggest question
regards whether or not it is good programming practice to have data objects
as members of my GUI class or if it should be done another way? I have my
main class which calls the GUI class. For now in my most basic skeleton, I
have a very simple student class, contains has a grade class. How should
these classes be arranged?
My first thought was have student a member of the GUI class. Say I have a
form with nothing more then two text fields for name and grade, and a
button. When I click the button, I want to store the the textfield data in
the student/grade classes. I can do that fine if student is a member of the
GUI class, but for some reason Im uncomfortable with this design. It seems
the GUI should be design only, no data access code in there. Eventually I
want to add database connection objects to this model for permanent student
data storage and would need to know where those would be called from as
well. So what do you guys think?
Classes:
Main
Gui
Student -> Grade
How to arrange?
Thanks
Rv5
side project that will help a teacher friend of mine work out grades. I
want a GUI interface that will store and retrieve grading info. So Im
hoping someonecan walk me through my class structure. My biggest question
regards whether or not it is good programming practice to have data objects
as members of my GUI class or if it should be done another way? I have my
main class which calls the GUI class. For now in my most basic skeleton, I
have a very simple student class, contains has a grade class. How should
these classes be arranged?
My first thought was have student a member of the GUI class. Say I have a
form with nothing more then two text fields for name and grade, and a
button. When I click the button, I want to store the the textfield data in
the student/grade classes. I can do that fine if student is a member of the
GUI class, but for some reason Im uncomfortable with this design. It seems
the GUI should be design only, no data access code in there. Eventually I
want to add database connection objects to this model for permanent student
data storage and would need to know where those would be called from as
well. So what do you guys think?
Classes:
Main
Gui
Student -> Grade
How to arrange?
Thanks
Rv5