architecture

niquola 2022-08-14T09:42:53.046389Z

While making functional decomposition of the systems it worth to visualize the architecture. UML class diagrams can be used for datastructures! But I'm curious how do you draw the functions and interactions (calls)? Flowcharts? Blocks and arrows with params over arrows?

Eugen 2022-09-08T03:28:40.691299Z

I wonder if something like polylith can help this visualisation. IMO seeing all functions can be a lot. Visualising polylith components via interfaces and their calls might be good enough middle ground. this could be some good tooling for polylith https://polylith.gitbook.io/polylith/introduction/polylith-in-a-nutshell .

Eugen 2022-09-08T03:32:50.439809Z

poly tool has some basic cli visualisation based on deps . perhaps one based on namespaces and interface calls might be worth an investigation

tengstrand 2022-09-08T04:41:09.408659Z

Good morning. When I think about dependencies in Polylith, it helps comparing the bricks (components and bases) with libraries, but as if they lived in one single shared mono-repo without the need of versioning. I think the main reason we sometimes create diagrams out of library dependencies, is because a library graph of dependencies often contains different versions of the same library, and that we sometimes want to sort out why the resolved version creates problems for us. If all the code/libraries were in sync (as in a Polylith workspace) we would not have that problem. A Polylith workspace is a place where we are in charge for how things change over time, which allows us to skip the versioning and instead work against the latest commit and at the same time feel some confidence that everything works together, that all our contracts (component interfaces) are fulfilled, that we don’t have any circular dependencies, and that the tests are green. When all this is assured, a graph will add less value to us. What’s important is instead which libraries and bricks we use. This is why the poly tool just lists the building blocks (components, bases, and libraries) in alphabetical order instead of showing them as a diagram (see https://polylith.gitbook.io/polylith/conclusion/production-systems). Just to be clear. I’m not advocating putting all the libraries in the world in a single mono-repo to get rid of the versioning. This would be almost impossible and not even desirable, and the tests would take forever to run!

Alejandro 2023-04-02T19:53:17.541619Z

@nicola, have you tried the artist-mode in emacs? Diagrams can't be any closer to source code than that. Here's quick demo: https://www.youtube.com/watch?v=cIuX87Xo8Fc

pithyless 2022-08-15T16:04:27.980239Z

If we're not talking about specific implementations, but ideas about visualizing in general, I think Eric Normand's book "Grokking Simplicity" has some good insights to gleam. (I hope Eric Normand and Manning do not mind if I post 2 screenshots in a public forum).

pithyless 2022-08-15T16:06:20.645709Z

It's always important to ask, what question are you trying to answer via visualization. 1. How do these functions/components depend or interact with each other? 2. Are there ways we can group sets of functions/components by commonality?

pithyless 2022-08-15T16:06:53.123009Z

One way to answer these two questions is with a DAG visualization which identifies who is calling/depending on what:

pithyless 2022-08-15T16:07:03.699929Z

pithyless 2022-08-15T16:09:50.500319Z

The nodes can be considered functions/components; the rows are some way of grouping them together (eg. namespaces/subsystems); and the arrows are explicit dependencies. This way you can visualize: "are we building a system that goes from abstract to concrete?" (arrows should not be going up), "are we missing layers of abstraction?" (e.g. if an arrow is reaching down past many layers downward), "is this depending on too many things?" (too many arrows), "circular dependencies?", etc.

pithyless 2022-08-15T16:11:13.619519Z

Another visualization is when you consider not the system at rest, but when it is in motion (things are calling other things: concurrency and time are possible culprits)

pithyless 2022-08-15T16:11:28.435579Z

Timeline vizualization:

pithyless 2022-08-15T16:11:35.072639Z

pithyless 2022-08-15T16:13:26.570289Z

Here we are vizualizing that there may be things happening concurrently and we need to consider all permutations of when things happen (and we also vizualize points of forking and merging where we can simplify our reasoning and consider as if things were single-threaded; perhaps because results are independent or we can rely on specific concurrency primitives)

pithyless 2022-08-15T16:16:36.723509Z

Not sure if that's what you were asking for @nicola - but perhaps it will help spark some solutions to your problem. And if this seems like a good direction, I recommend checking out Eric Normand's book "Grokking Simplicity" - he goes into a lot more detail on this subject :)

niquola 2022-08-15T16:23:22.399579Z

Thank you! I'm thinkering about this. The idea is to visualize architecture based on functions/procedures not classes/objects. It's definitely gonna be blocks and arrows - question is how? I will share my version.

Alejandro 2023-02-08T08:27:21.230189Z

Hey, @nicola. Have you found a tool that fits your needs?

karkunow 2022-09-22T11:06:16.696849Z

Here is a nice talk about diagrams: https://youtu.be/HmHOYkTVxIg You can try use FC4 or C4 model to draw your flows: https://c4model.com/

👍 1
niquola 2023-02-09T19:35:19.647939Z

Hi, i did not find - drawing circles in figma for functions :)