...
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.
Drawio |
---|
border | true |
---|
| |
---|
diagramName | Existing Delete Anchor Sequence Diagram |
---|
simpleViewer | false |
---|
width | 400 |
---|
links | auto |
---|
tbstyle | top |
---|
lbox | true |
---|
diagramWidth | 629 |
---|
revision | 2 |
---|
|
Drawio |
---|
border | true |
---|
| |
---|
diagramName | Proposed Delete Anchor Sequence Diagram |
---|
simpleViewer | false |
---|
width | 400 |
---|
links | auto |
---|
tbstyle | top |
---|
lbox | true |
---|
diagramWidth | 629 |
---|
revision | 2 |
---|
|
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 |
---|
title | Delete SchemaSet Business Logic |
---|
linenumbers | true |
---|
|
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 |
Drawio |
---|
border | true |
---|
| |
---|
diagramName | Existing Delete Schema Set |
---|
simpleViewer | false |
---|
width | |
---|
links | auto |
---|
tbstyle | top |
---|
lbox | true |
---|
diagramWidth | 688 |
---|
revision | 2 |
---|
|
...