Re: Custom container + Child type with interface



On Sun, Dec 20, 2009 at 07:47:55PM +0000, Matthew Bucknall wrote:
> Yes, it does. But as far as I can tell, implementers of the interface
> cannot override the GParamFlags of an interface property with some
> superset. Effectively, implementers can only override the property's
> getter/setter. Please let me know if I've got that wrong.

You are probably right, only the getter and setter are overridable.

I've always considered property overrding a desperate measure because if
the original getter and setter called a virtual method you could
override that and it would be the preferred solution.

Unfortunately, it would not help in your case.

> This is why it seems I could only go with the lowest common denominator
> of GParamFlag settings in the interface definition. Which I agree makes
> a total mess of the 'is-a' paradigm - which is something I'm trying to
> avoid.

Another possibility is to simply avoid the definition of properties and
define getters (in the interface) and setters (in specific classes).  It
is a logical way out because the primary purpose of properties is to
enable generic manipulation.  But if you cannot satisfy the
substitutability relation then you lose the generic manipulation ability
anyway.

Regards,

Yeti



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]