Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add article "Architecture verification and documentation with jQAssistant and arc42" #56

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stmu-zuhlke
Copy link

No description provided.

Copy link

@stse stse left a comment

Choose a reason for hiding this comment

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

I like it. At the end you are talking about the steep learning curve. I fully agree with that. On suggestion from my side would therefore be to maybe also explain how to execute the rules and how those rules are basically structured and how they work, butI haven't looked into the example project. Maybe this would answer my questions.

For reporting, we'll use the [jqassistant-asciidoctor-extension](https://github.com/jqassistant-tooling/jqassistant-asciidoctorj-extensions), which is an extension for asciiDoctor parsing the jQAssistant report and providing inculde directives for the results.
As a documentation template, we’ll employ [arc42](https://arc42.org), a framework for documenting software architectures. It already provides a structure we can hook in and is available as [asciiDoc template](https://arc42.org/download#file-based-formats).

You'll find the documentation in the `src/docs` directory of our sample project. TThe project is pre-configured with the Asciidoc Maven plugin and the Asciidoc multipage HTML plugin, which creates a beautiful multipage documentation in your `target/docs` folder, when running the project with `mvn verify`.
Copy link

Choose a reason for hiding this comment

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

Spelling: TThe -> The


In our sample project you'll find the ADR examples in the folder `src/docs/adr`.

With the yaml files ingested by jQAssistant we can then write concepts and constraints targeting those nodes. Finally we can include all ADR documentation files in the architecture design desciions document.
Copy link

Choose a reason for hiding this comment

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

Spelling desciions

@stse
Copy link

stse commented Oct 1, 2024

Another thing I usually struggling with is how to identify the stereotype e.g. is it an entity, an adapter, a port an infrastructure level component, an application service,... of a class if this is not encode in the package structure. For example it is usual in a DDD approach to structure your application based on the bounded contexts and aggregate roots which means you package name looks similar to lab..<context/aggregate root> and everything, e.g. repository events services,... is included in this package. Packages are cut according to domain aspects not to technical aspects. In this case I need something else to identify the stereotype of a class. Any Idea?

@stmu-zuhlke
Copy link
Author

Another thing I usually struggling with is how to identify the stereotype e.g. is it an entity, an adapter, a port an infrastructure level component, an application service,... of a class if this is not encode in the package structure. For example it is usual in a DDD approach to structure your application based on the bounded contexts and aggregate roots which means you package name looks similar to lab..<context/aggregate root> and everything, e.g. repository events services,... is included in this package. Packages are cut according to domain aspects not to technical aspects. In this case I need something else to identify the stereotype of a class. Any Idea?

You are right, the given sample project is quiet simple and represents only one context. This makes it easy to identify the concepts based on the conventions (but this was intentional to keep it simple here :D )
with a multi context setup you could still use the depth of packages and then go deeper there (cypher provides some string functionality and with ASOP.
There is always some convention to identify it, be it naming conventions, package conventions or you could introduce your own annotations for that. If there is none, you should create one to make concepts explicit and visible.

Basically this is about testability of the architecture. We already do it with code : make it small, make it independent, if you cannot write a test for it there's something fishy. Same goes for architecture: if you cannot test your implementation structure easy enough, maybe something should be more visible or also amybe something is not there at all.

@stmu-zuhlke
Copy link
Author

I like it. At the end you are talking about the steep learning curve. I fully agree with that. On suggestion from my side would therefore be to maybe also explain how to execute the rules and how those rules are basically structured and how they work, butI haven't looked into the example project. Maybe this would answer my questions.

Thanks :)
Actually I started over multiple times, diving into the "how" just to realise that I basically re-sample blog entries and manuals which are already there and doe it way better (e.g. the link in the introduction). That's the reason why I concentrate more on the "why" and bring up some ideas how to actually use this tool

Copy link

@immo-huneke-zuhlke immo-huneke-zuhlke left a comment

Choose a reason for hiding this comment

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

Great article. I noticed a couple of spelling errors, which I have noted in the text.

There's a certain barrier to adoption, which is the very technical syntax of the XML rules file(s). I wonder whether this might be usefully overcome by using Anthony Anjorin's Pedantic extension to MPS - this is a model-building tool par excellence, which may be able to generate the specification language without requiring users to learn its syntax.

Anthony is a member of our Global CDQ practice. His github repo can be found under https://github.com/anthonyanjorin


## Showcase: ADR validation

To show what I mean with "living documentation" and what is possible besides analysing code using jQAssistant, I created a showcase, validating [Architecture Descicion Records (ADR)](https://github.com/joelparkerhenderson/architecture-decision-record).

Choose a reason for hiding this comment

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

Spelling: Descicion -> Decision


With everything in place, we are now ready to incorporate the results into the documentation..
As you may recall, our objective is to provide a comprehensive overview of all ADRs and their associated constraints.
o facilitate this, we are introducing a new concept called `adr:constraintReport`. This concept does not modify the graph in any way. Rather we use the query result as a structured report.

Choose a reason for hiding this comment

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

Missing "T" at start of line

@stmu-zuhlke
Copy link
Author

Great article. I noticed a couple of spelling errors, which I have noted in the text.

There's a certain barrier to adoption, which is the very technical syntax of the XML rules file(s). I wonder whether this might be usefully overcome by using Anthony Anjorin's Pedantic extension to MPS - this is a model-building tool par excellence, which may be able to generate the specification language without requiring users to learn its syntax.

Anthony is a member of our Global CDQ practice. His github repo can be found under https://github.com/anthonyanjorin

This sound like an interesting approach. I am not really fluent with DSLs and MPS but will have a look into this.
However, from author's viewpoint I find it interesting that you see the xml as a possible barrier, since the main implementation of the rules is written in Cypher (the query language from neo4j). The xml is just metadata and orchestration.
I think I will remove the xml part from most of the code blocks to make this more clear and also add a section about the workflow how such rules can be developed using the neo4j tools.
Because what you are doing in the end is, creating your own "domain" graph within neo4j and query it.

@stmu-zuhlke stmu-zuhlke marked this pull request as draft October 1, 2024 12:04
@immo-huneke-zuhlke
Copy link

This sound like an interesting approach. I am not really fluent with DSLs and MPS but will have a look into this. However, from author's viewpoint I find it interesting that you see the xml as a possible barrier, since the main implementation of the rules is written in Cypher (the query language from neo4j). The xml is just metadata and orchestration.

Thanks for clarifying. I really meant the parts embedded in the XML as CDATA. I would imagine that there's a lot of scope for subtle errors if this is edited directly. Of course, if you're using another tool to develop the Cypher statements this is a different matter (particularly if you can unit-test the query language statements somehow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants