Midnighter / structurizr-python

A Python 3 port of Simon Brown's Structurizr diagrams-as-code architecture description tool.
https://structurizr.com/
Apache License 2.0
65 stars 16 forks source link

Issue 77: Add dynamic views #78

Closed yt-ms closed 3 years ago

yt-ms commented 3 years ago

Add support for dynamic views, which show how element collaborate by sequencing interactions. Based on the Java implementation.

As well as the "parallel" sequence provided in the Java implementation, I've also added a "subsequence" which allows you to get the "1.2", "1.3" style numbering for sub-calls but doesn't seem to be in the Java implementation.


THIS SOFTWARE IS CONTRIBUTED SUBJECT TO THE TERMS OF THE Apache License v.2.0. YOU MAY OBTAIN A COPY OF THE LICENSE AT https://www.apache.org/licenses/LICENSE-2.0.

THIS SOFTWARE IS LICENSED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE MAY BE REDISTRIBUTED TO OTHERS ONLY BY EFFECTIVELY USING THIS OR ANOTHER EQUIVALENT DISCLAIMER IN ADDITION TO ANY OTHER REQUIRED LICENSE TERMS.

codecov-commenter commented 3 years ago

Codecov Report

Merging #78 (fd724e9) into devel (cd63e68) will increase coverage by 1.88%. The diff coverage is 98.51%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel      #78      +/-   ##
==========================================
+ Coverage   91.87%   93.76%   +1.88%     
==========================================
  Files          70       74       +4     
  Lines        2155     2327     +172     
  Branches      215      241      +26     
==========================================
+ Hits         1980     2182     +202     
+ Misses        158      119      -39     
- Partials       17       26       +9     
Impacted Files Coverage Δ
src/structurizr/view/view.py 89.71% <93.33%> (+16.25%) :arrow_up:
src/structurizr/view/view_set.py 68.09% <95.65%> (+7.82%) :arrow_up:
src/structurizr/view/dynamic_view.py 100.00% <100.00%> (ø)
src/structurizr/view/interaction_order.py 100.00% <100.00%> (ø)
src/structurizr/view/relationship_view.py 97.43% <100.00%> (+8.54%) :arrow_up:
src/structurizr/view/sequence_counter.py 100.00% <100.00%> (ø)
src/structurizr/view/sequence_number.py 100.00% <100.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update cd63e68...fd724e9. Read the comment docs.

yt-ms commented 3 years ago

I've just spotted that the relationship views need to be ordered when returned, so need to implement that before this PR is merged.

yt-ms commented 3 years ago

I've just spotted that the relationship views need to be ordered when returned, so need to implement that before this PR is merged.

OK, this is done now.

yt-ms commented 3 years ago

For the ordering of views, I've added a new ViewOrder class, which I think helps separate concerns better. See what you think.

Midnighter commented 3 years ago

What a monster work! Thanks a lot 🙂