M
Matthias Kaeppler
Hello,
this more a question about good practice than it is about the C++
language itself, but still... my question is this:
I have a class representing the main window of my application which is
really growing big. Well, most of the action is happening in the main
window in my app so that's okay I guess. To solve the clutter, I thought
about splitting up the class into several smaller ones, but that didn't
feel right, mainly because it would have gone along with an increase of
complexity (further interaction would be needed between several classes)
which just isn't worth it.
Now my other idea was to group functions which share certain semantics
(e.g. signal handlers) into separate compilation units. However, this
would mean breaking up the class and spreading it over several files. I
had a look at the Nautilus source code, and that's how they do it and I
think it's a really good approach, but it's written in C afterall, so
I'm not sure if that applies to C++ as well.
Is that bad practice in C++? What would you do instead?
Regards,
Matthias Kaeppler
this more a question about good practice than it is about the C++
language itself, but still... my question is this:
I have a class representing the main window of my application which is
really growing big. Well, most of the action is happening in the main
window in my app so that's okay I guess. To solve the clutter, I thought
about splitting up the class into several smaller ones, but that didn't
feel right, mainly because it would have gone along with an increase of
complexity (further interaction would be needed between several classes)
which just isn't worth it.
Now my other idea was to group functions which share certain semantics
(e.g. signal handlers) into separate compilation units. However, this
would mean breaking up the class and spreading it over several files. I
had a look at the Nautilus source code, and that's how they do it and I
think it's a really good approach, but it's written in C afterall, so
I'm not sure if that applies to C++ as well.
Is that bad practice in C++? What would you do instead?
Regards,
Matthias Kaeppler