[Dev] redirect and Who, About and Date
vajda at osafoundation.org
Wed Mar 8 18:02:54 PST 2006
On Wed, 8 Mar 2006, Phillip J. Eby wrote:
> At 05:43 PM 3/8/2006 -0800, Andi Vajda wrote:
>> On Wed, 8 Mar 2006, John Anderson wrote:
>>> I'm planning on getting rid of redirect attributes to handle the Who,
>>> About and Date attributes in the Summary Table. Instead I plan to add an
>>> explicit Who, About and Date attribute. By noticing when attributes that
>>> affect the value of Who, About or Date change (using onValueChanged), I'll
>>> update Who, About and Date as necessary.
>>> This is simple to implement and eliminates the current problem where Who,
>>> About and Date sometimes doesn't display the correct value. It also
>>> doesn't require a special "computed attribute" that isn't stored in the
>>> repository, so you can always search for Who, About and Date like any
>>> other attribute. Finally, it allows Andi to get rid of redirect, which
>>> simplifies the repository design.
>> We recently discussed something related to this on IRC and came up with a
>> new attribute aspect, bequeathTo, that would allow you not to have to use
>> onValueChanged() to bequeath a value from an attribute to another attribute
>> after it changed.
>> I'm planning on implementing this in the next few weeks.
> So how does this work? Is this only for copying attribute values, or does it
> run some code when the dependent attribute changes?
No code is run, the value is taken as is and set into the 'heir''s attribute.
> For what we're talking about here, I don't think just copying the value is
> going to suffice if type conversions are involved.
The 'bequeathTo' aspect came up in the context of avoiding item loading when
running filter expressions in filter collections. 'bequeathTo' was meant as a
way of increasing value locality by caching them on the item being passed
through the filter.
If any sort of smarts are needed to convert, conditionally set, or otherwise
go beyond a simple setting of the same value, 'bequeathTo', as discussed
earlier, is not good enough. 'bequeathTo' was born as the opposite of
'inheritFrom' - hence its name - which also just returns an inherited value,
without any conversion.
More information about the chandler-dev