First. I'm really sorry if this has been talked before, I have my noob hat on .
The issue at hand: I'm creating an aplication and it should have lots of stuff... but my main concern at this point is: Should I put every frame, panel, dialog, etc on 1 "cpp & h"? or should I create 1 "cpp & h" for each frame and/or dialog?
In the first option, communication between the objects seems to be easier, but in the second option it kinda seems more organized and stuff...
Any advanced user care to give me a tip here?
Thanks for your time ppl
1 big class or 1 for each frame - Choice? Topic is solved
1 big class or 1 for each frame - Choice?
"If it ain't broken... give it a little more time... it will break eventually..."
-
- Experienced Solver
- Posts: 72
- Joined: Fri Feb 20, 2009 7:13 pm
- Location: $(#wx)\src
If your declaring a class that's already made, then no. You would just link to the header of that class and then declare the class.
It's very common practice to make separate files for the sake of code reuse. Though it is valid to stick everything inside of one big as OMGHELL .cpp and .h file. But it becomes very unmanageable and almost to a stupid level of frustration and broken keyboards. It should be based completely on your opinion of organization and management. If you think that every extended and new class deserves a new .h and .cpp then go for it. If you think that they don't, then you need to learn more about design lololol. If the below link contradicts what I said, please go with it. I suck at design lol. It makes my programs look like a big pile of dog du du as well.
http://www.cprogramming.com/tutorial/class_design.html
Code: Select all
MyClass aClass;
//or
MyClass aClass(); //Default constructor of class.
http://www.cprogramming.com/tutorial/class_design.html