S
superheathen
Hi,
While I think I have a reasonable grasp of C++ in general, I've never
really used it more than a convenient C. as such, I'm finding very
basic OO confusing, not so much the concept, but how everything should
be laid out in practice.
One of those is deciding whether or not a class should be inherited
or declared as an object in the class.
note: this isn't isn't a specific problem, just making pseudo code as
an example.
class RootProgramClass : public ConfigClass, public Window
{
}
vs.
class RootProgramClass
{
ConfigClass config;
Window window;
}
How about appropriate use of constructors? something tells me a
constructor taking arguments just to pass onto an inherited classes
constructor, to pass onto the final classes constructor, to initialize
the classes variables, isn't very good design. Are there ways to avoid
this mess and allow the programmer to initialize an double inherited
classes variables neatly.
these are all newbish questions and it shames me to ask them,
unfortunately I'm nothing more than a hobbyist so don't have the
benefit of university level courses, etc.
any resources on good OO design, etc. would be appreciated.
While I think I have a reasonable grasp of C++ in general, I've never
really used it more than a convenient C. as such, I'm finding very
basic OO confusing, not so much the concept, but how everything should
be laid out in practice.
One of those is deciding whether or not a class should be inherited
or declared as an object in the class.
note: this isn't isn't a specific problem, just making pseudo code as
an example.
class RootProgramClass : public ConfigClass, public Window
{
}
vs.
class RootProgramClass
{
ConfigClass config;
Window window;
}
How about appropriate use of constructors? something tells me a
constructor taking arguments just to pass onto an inherited classes
constructor, to pass onto the final classes constructor, to initialize
the classes variables, isn't very good design. Are there ways to avoid
this mess and allow the programmer to initialize an double inherited
classes variables neatly.
these are all newbish questions and it shames me to ask them,
unfortunately I'm nothing more than a hobbyist so don't have the
benefit of university level courses, etc.
any resources on good OO design, etc. would be appreciated.