Providing Remove and Delete Functionality

Difference Between Remove and Delete

A remove feature only eliminates pictogram elements from the pictograms model but the underlying business object (domain model elements) remains in existence. It is basically the opposite of the add feature, which creates a pictogram element for an existing business object.

A delete feature additionally eliminates the corresponding business object (domain model elements). It is basically the opposite of the create feature, which creates a business object and the corresponding pictogram element.

A delete feature typically calls the remove feature to delete the pictogram element and then deletes the corresponding business object. This is similar to the create feature, which typically creates the business object and then calls the add feature to create the corresponding pictogram element.

Creating a Remove Feature

A remove feature has to implement the interface IRemoveFeature. Instead of implementing this directly you should extend the available default implementation DefaultRemoveFeature.

Own implementations of remove features have to be provided by the corresponding feature provider through its getRemoveFeature method. Note, that in most cases it is not necessary to provide an own implementation of the remove feature, because the graphics framework has enough knowledge to provide a good default implementation.

To enable the remove of not selectable, so called inner elements, you have to provide custom features.

Creating a Delete Feature

A delete feature has to implement the interface IDeleteFeature. Instead of implementing this directly you should extend the available default implementation .

Own implementations of delete features have to be provided by the corresponding feature provider through its getDeleteFeature method. Note, that in most cases it is not necessary to provide an own implementation of the delete feature, because the graphics framework has enough knowledge to provide a good default implementation.

To enable the deletion of not selectable, so called inner elements, you have to provide custom features.