Skip to content

Conversation

@yt-ms
Copy link
Collaborator

@yt-ms yt-ms commented May 11, 2021

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
Copy link

codecov-commenter commented May 11, 2021

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%) ⬆️
src/structurizr/view/view_set.py 68.09% <95.65%> (+7.82%) ⬆️
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%) ⬆️
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 yt-ms marked this pull request as ready for review May 11, 2021 16:47
@yt-ms yt-ms requested a review from Midnighter May 11, 2021 16:48
@yt-ms
Copy link
Collaborator Author

yt-ms commented May 12, 2021

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
Copy link
Collaborator Author

yt-ms commented May 12, 2021

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 yt-ms linked an issue May 13, 2021 that may be closed by this pull request
1 task
@yt-ms yt-ms mentioned this pull request May 13, 2021
4 tasks
Copy link
Owner

@Midnighter Midnighter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the hard work on this PR. I did not actually run it but it looks well implemented from reading the code.

I am wondering about one potential design change. What if the order attribute's value was not a string but an actual instance of some SequenceNumber class? (Not necessarily like the one you have implemented at the moment.) One major benefit that I see is that the ordering is then encapsulated in that class simply the dunder methods __eq__ and __lt__. What do you think?

@yt-ms
Copy link
Collaborator Author

yt-ms commented Jun 7, 2021

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

@Midnighter
Copy link
Owner

What a monster work! Thanks a lot 🙂

@Midnighter Midnighter merged commit 4778f21 into Midnighter:devel Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants