[asterisk-dev] Reverse Inheritance
John Todd
jtodd at digium.com
Mon Nov 10 21:24:05 CST 2008
On Nov 10, 2008, at 4:11 PM, Tilghman Lesher wrote:
> During a review of one of the bugs on the bugtracker (13140), I
> found that
> somebody had implemented what is essentially a reverse-inheritance
> on a
> variable. What occurs to me is that if one person wants it, perhaps
> it would
> be wise to implement it in a general way, so that others may also
> benefit from
> that behavior.
>
> This brings up two questions in my mind. First, what are the
> safeguards that
> we must abide by to ensure that nothing unsafe happens? For one
> thing, I
> think it would be sensible to ensure that variables can only be set,
> not
> overwritten with this method. Can anybody think of other possible
> problems
> with implementing reverse inheritance?
>
> Second, how should variables be denoted? I have discussed this with
> Jared
> Smith, and we both agreed that using '+' in place of '_', where '_'
> means
> forward inheritance and '+' means reverse inheritance would be
> appropriate.
> Doubling either symbol would denote infinite inheritance in that
> particular
> direction. Is there any further discussion of this use, or is the
> usage
> of '+' an acceptable symbol?
>
> --
> Tilghman
These symbols seem fine, but in the long view it is perhaps the case
that the "_" character was incorrect as the leading indicator for
forward inheritance. It seems, logically, that "+" and "++" should
represent forward and infinite forward inheritance, and "-" and "--"
should indicate reverse and infinite reverse inheritance. We may be
too far out of the gate for this type of serious change (or shift) to
be practical, and there may be other syntactical/parsing reasons why
what I think is reasonable is not a practical nomenclature.
I see this as being useful and avoiding the astdb hackery that I've
used in the past to move values between channels from "beyond the (h)
grave."
JT
---
John Todd
jtodd at digium.com +1-256-428-6083
Asterisk Open Source Community Director
More information about the asterisk-dev
mailing list