Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this proposal,  the business logic of the 'Delete SchemaSet' and 'Delete Anchor' functionality will be moved to Service Layer and domain-specific services will be used to do any operation of those domain objects. 

Delete Anchor

When an anchor gets deleted, all the associated data nodes should get deleted too. The suggestion is to use DataService to delete the data nodes instead of using Fragment Repository directly.

draw.io Diagram
bordertrue
diagramNameExisting Delete Anchor Sequence Diagram
simpleViewerfalse
width400
linksauto
tbstyletop
lboxtrue
diagramWidth629
revision2

draw.io Diagram
bordertrue
diagramNameProposed Delete Anchor Sequence Diagram
simpleViewerfalse
width400
linksauto
tbstyletop
lboxtrue
diagramWidth629
revision2

Delete Schema Set

Schemaset contains the model against which the anchor data nodes are validated. So, when a schema set is deleted, the logic to validate if associated anchors exist and whether it can be deleted is business logic and should be in the Service layer.

Code Block
titleDelete SchemaSet Business Logic
linenumberstrue
DELETE SCHEMASET( dataspaceName, schemaSetName, cascadedAllowed)
      anchors = CALL Get Anchors associated with Schema Set ( dataspaceName, SchemaSetName )
	  IF Cascade is Prohibited & anchors exists
 			throw exception
      END IF
	  Delete associated anchors if casacade allowed
	  Delete SchemaSet
END


draw.io Diagram
bordertrue
diagramNameExisting Delete Schema Set
simpleViewerfalse
width
linksauto
tbstyletop
lboxtrue
diagramWidth688
revision2

...