[Kde-bindings] rbuic problem ?

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Oct 7 21:35:40 UTC 2004


On Thursday 07 October 2004 16:46, Thibauld Favre wrote:
> Also, I'm not sure that generating *by default* attr_reader attribute
> accessors for rbuic generated class is a good idea. attr_reader is useful
> for certain things but it should not be generated automatically as it
> basically breaks the encapsulation paradigm of OOP.
> If I want some of my instances variables to be reachable outside my class,
> I can do it myself by specifying exactly which ones I want to be
> accessible. I don't know what the majority is thinking but I'm really for
> removing this feature. Or maybe just put it as an rbuic option, something
> like
> "--make-variables-visible" as I must admit it can be useful sometimes if
> you design it like this and don't want to have to manually add an
> attr_reader for each of your instance variables.
The warnings are when there is an existing method with the same name at the 
attribute accessor. Not all the instance variables had attribute accessors 
generated - the layout managers didn't for instance. I think the main widgets 
should be visible from outside, I don't think that breaks encapsulation. But 
if there is an attr_reader method, a method with the same name shouldn't be 
generated to suppress the warning.

-- Richard



More information about the Kde-bindings mailing list