Skip to content

Overridable implicit relationshipΒ #455

@tomas0svk

Description

@tomas0svk

Description

Hello.
I was not very satisfied with the way implicit relationship is created and displayed, if there are 2 or more relations between lower-level elements.

  • CreateImpliedRelationshipsUnlessSameRelationshipExistsStrategy - displays ALL links which yields to cluttered diagrams
  • CreateImpliedRelationshipsUnlessAnyRelationshipExistsStrategy - displays ONE link - but with description selected from one of them (first wins?), which (I.) may be odd and inaccurate (II.) is not easy to detect, because diagram looks fine.

Our preferred approach would be to use the former, then find duplicate links and override them (if needed) by specifying a relationship between two higher-level elements - with more generalized description (e.g. Writes do DB + Reads from DB = Uses DB). Is this approach fine, do you see any problems? I don't, higher-level relation is not displayed on lower-level diagram.

However, this way we end up by having all the implied relations + the one generalized.

The issue may be
CreateImpliedRelationshipsUnlessSameRelationshipExistsStrategy :
boolean createRelationship = !source.hasEfferentRelationshipWith(destination, relationship.getDescription());

It creates implicit relationship if not exists by comparing both source and destination elements and relationship's description.
Hence if I add explicit relation with generalized description, it is not detected.

Would it be solved by adding another strategy (let's call it CreateImpliedRelationshipsUnlessSimilarRelationshipExistsStrategy' - using overload of hasEfferentRelationshipWith without description?
public boolean hasEfferentRelationshipWith(Element element)
vs.
public boolean hasEfferentRelationshipWith(Element element, String description)

Priority

Low (I'm willing to make a pull request - please add a comment below summarising your approach before making a PR)

More information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions