[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    Re: m_subject
From:       Patrick Julien <freak () codepimps ! org>
Date:       2003-11-21 0:30:21
[Download RAW message or body]

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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic