Re: handling properties of multiple objects



At 03.12.2008 19:33, Sameer Sahasrabuddhe wrote:
On 12/3/08, Sameer Sahasrabuddhe <sameerds gmail com> wrote:
Now here's a new way to track object copies, that tackles both these
issues: instead of keeping a copy of the object in the dialog, we
extend the property description itself, to carry a copy of the object
from which it was derived. As a result, no matter how many objects are
involved, only one object is used for updating the widget for each
property.

Errr ... saw the problem with this immediately after posting the mail.
If multiple prop descriptions are originally derived from the same
object, then each will have a copy of that object. So instead of one
kind of memory overuse, we end up with another kind.

I'm still confused (not only by the term object not to be confused with DiaObject in your mail?) ;)

For Dia's property mechanism three classes are involved:
- PropDescription: a constant instance just describing the type of ...
- Property: initially created by copying it from the internal state of ...
- DiaObject: a diagram element having multiple properties. They can be
  modified by passing in a Property instance from where the respective
  internal state in the object are adjusted.

The Property objects are just needed for communication (and undo) but they are not owned by the DiaObject instances. Maybe it is too late today, but if you replace most of the 'object' in your original mail with these Proeprty objects it may work. Of course the Proeprty instance should not be hold by the (constant) PropDescription but instead the Property object already has a reference to it's PropDescription.

I guess a new property dialog remains the only alternative. The memory
bloat involved with huge groups will have to be tackled when it does
actually become painful.

That new diaog just needs to contain one vector of unique properties. This vector will get partially modified by the dialog and feeded into the various objects of the selection (or just one for the single selection case).

        Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



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