Skip to content
Marek Fišera edited this page Nov 26, 2015 · 3 revisions

Models.Deleters are 'dispatcher'-like pattern for deleting objects. By passing object key (IKey) you obtain information whether this object can be deleted from storage and what next must be deleted before deleting this object.

Behind dispatcher there is registered handler for deleting object by its type. This handler is responsible to determining whether the object can be deleted and optionally which objects depend on it. Providing this context the handler informs caller what to delete to delete the object.

Typical use-case

  1. User clicks on delete button.
  2. The handler is invoked to determine whether the object can be deleted and provided information about optional references to other objects.
  3. Message box is rendered with the information about references and deletion confirmation.
  4. User confirms that object should be deleted with referenced objects.
  5. The object is deleted.

Clone this wiki locally