briggySmalls / archie

Tool for documenting system architecture
https://briggysmalls.github.io/archie
MIT License
2 stars 2 forks source link

Fix inconsistency in context connectins #14

Open briggySmalls opened 4 years ago

briggySmalls commented 4 years ago

The context diagram will draw an association between two elements that are within the scope.

However if one of the elements contains sub-elements and is made the scope of a context diagram, the same association will not be drawn to the enclosing scope 'package'.

This is inconsistent behaviour, either:

  1. Associations cannot have a source/destination that has sub-elements
  2. Associations should be drawn to/from elements that are the enclosing scope in a context diagram
briggySmalls commented 4 years ago

I think I'd rather go with option 2 (more freedom) vs. option 1 (more opinionated)

briggySmalls commented 4 years ago

I wonder if opinions could be captured as 'warnings' when parsing the model, rather than forcing it to stop working?

briggySmalls commented 4 years ago

This is pretty annoying to implement.

Curently all 'implicit' relationships are added, and checked if they link elements of interest. The way excessively 'abstract' implicit relationships are ignored is by controlling the 'elements of interest'.

Adding the 'scope' element to the elements of interest would, at present, cause any exisiting correct relationships to be duplicated with an abstract one added to their parent (the scope).

briggySmalls commented 4 years ago

The diagram below tries to illustrate a set of relations.

relations(1)

If a context diagram is to be generated, putting C as the scope then 'D' will be added as a 'main' object. No associations will be added because D is not connected to anything, neither explicitly or implicitly.

If C were added as an object of interest then the diagram would display the correct connections.

However if this change was implemented regressions would appear

realtions-2

Now, correctly, an A -> D connection would appear. However an A -> C connection would also appear. This is no good.

briggySmalls commented 4 years ago

This feels like it is to be solved in view (same logic for tag and context) by looking at explicit relationships that have one end connected to an anscestor of the primary elements.

But then the implicit relationships are still required as the non-primary end may need to be changed to a parent element

briggySmalls commented 4 years ago

realtions-2-Page-2(1)

Ok. One further. This is the nasty example alluded to in the previous comment.

With two explicit associations. One nicely between two leaf elements - tagged i). But one mean one that is from a leaf to a higher-level component (the scope) - tagged ii).

The final diagram should contain:

This is annoying because without care the association A -> C will show both tags, given they need to be found from implicit relationships.

It's making me think there needs to be a way of taking a set of associations and determinine their implicit associations. Rather than only allowing this for all associations in a model.

briggySmalls commented 4 years ago

Urgh, graphviz 'clusters' are a convention. And you cannot have a connection to a subgraph cluster without some nasty syntax and connecting to a child node... https://stackoverflow.com/questions/2012036/graphviz-how-to-connect-subgraphs