From kde-kimageshop Fri Nov 21 00:30:21 2003 From: Patrick Julien Date: Fri, 21 Nov 2003 00:30:21 +0000 To: kde-kimageshop Subject: Re: m_subject X-MARC-Message: https://marc.info/?l=kde-kimageshop&m=106937464619736 On November 19, 2003 03:24 pm, Boudewijn Rempt wrote: > While working on tools again, I noticed that there's a private > > KisCanvasSubject *m_subject; > > in both kis_tool_non_paint and in its descendants, with > > void KisToolColorPicker::update(KisCanvasSubject *subject) > { > super::update(subject); > m_subject = subject; > } > > updating both the parent's member variable and the object's own m_subject. > Is there a reason for that design -- i.e., is this preferable to making > m_subject protected? Yes, there is 3 types of inheritance: 1) Interface 2) Implementation 3) Data I do not use data inheritance for all the same reasons I don't use global variables. I understand why this was necessary to add them to C++ in the first place, see "The Design and Evolution of C++" for a rational, but it doesn't mean I use it under normal circumstances. Of course, it makes you wonder why more modern languages even support this feature in the first place :) _______________________________________________ kimageshop mailing list kimageshop@kde.org https://mail.kde.org/mailman/listinfo/kimageshop