[Smtk-developers] Inconsistent entity-attribute associations between Attribute and EntityRef

David Thompson david.thompson at kitware.com
Wed Jun 10 07:41:01 EDT 2015


Hi Yumin,

The m_associations member of Attribute was added specifically to make associations accessible in the same way as other Item children of an attribute. It should not be removed because that would require a lot of additional specialized code in the UI layer to present the same type of information as the ModelEntityItem. If there is a bug in the way synchronization between the attribute system and model manager occurs, it should be fixed.

    David



> On Jun 10, 2015, at 00:07, Yumin Yuan <yumin.yuan at kitware.com> wrote:
> 
> Hi Dave and Bob,
> 
> I noticed some inconsistency between Attribute and EntityRef, in terms of how to manage the associations between entity and attribute.
> 
> In Attribute class, there is a ModelEntityItem (m_associations) keeping track of the associated entities, and the Attribute::associateEntity() only updates m_associations without updating the Manager (so the manager's association record does not reflect the system), however Attribute::disassociateEntity() will update both m_associations and the Manager.
> 
> In EntityRef class, the EntityRef::associateAttribute() and EntityRef::disassociateAttribute() depend fully on the Manager to update the associations.
> 
> I suggest to remove the m_associations from Attribute, and use the Manager instead (like EntityRef) to manage associations. This will avoid keeping the same record in two places and potential mismatch between them.
> 
> Comments?
> 
> Yumin


More information about the Smtk-developers mailing list