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

A project not yet using the architecture style fails #99

Open
jamietanna opened this issue Jan 26, 2022 · 3 comments
Open

A project not yet using the architecture style fails #99

jamietanna opened this issue Jan 26, 2022 · 3 comments
Assignees

Comments

@jamietanna
Copy link

Adding i.e.

  @ArchTest
  @SuppressWarnings("unused")
  private final ArchRule onionArchitecture = JMoleculesArchitectureRules.ensureOnionClassical();

To a project not using the annotations to enforce layers currently passes, whereas I'd expect to have an error to highlight that the layers/etc aren't yet configured?

@odrotbohm
Copy link
Member

Can you elaborate why you think that should fail? If you don't express any concepts in the code, what exactly is there to validate? We react to explicit declarations of architectural concepts. If no code matches those, no code can violate rules attached to the concepts.

@ghost ghost assigned odrotbohm Feb 8, 2022
@odrotbohm odrotbohm transferred this issue from xmolecules/jmolecules Feb 8, 2022
@jamietanna
Copy link
Author

I've recently migrated a couple of codebases to jMolecules-codified architectures, and found that the first thing I reach for is a test to capture what is being done.

In the case that my project has pulled the jMolecules dependencies, adds the ArchUnit test to enforce a rule, but then doesn't have any annotations, I'd want the test to fail to give me the feedback that I've implemented it wrong.

Alternatively, I could have a complete codebase using the architecture style, remove the annotations, and the test would likely still pass, despite the annotations being gone, and nothing enforcing i.e. Onion rings?

@odrotbohm
Copy link
Member

odrotbohm commented Feb 8, 2022

What I am still not getting is what we would be supposed to report under which conditions? No concepts identified at all? Okay, we could report that. But then what about if you just annotate a single package with an architectural rule. It's still just as uncompletely-expressed architecture as before, but we can't really report anything "missing".

I.e. how much architecture you want to express in your codebase can vary from project to project, and we're not in the business of verifying completeness of that. First – and foremost – because it's impossible to define what constitutes "complete" or even just "enough".

I am inclined to close this as won't fix as the current behavior is in line with our design ideas: we verify the architectural ideas that you express, not the ones missing.

In the case that my project has pulled the jMolecules dependencies, adds the ArchUnit test to enforce a rule, but then doesn't have any annotations, I'd want the test to fail to give me the feedback that I've implemented it wrong.

Based on what? What constitutes "wrong" here? There's no definition of intention whatsoever in the codebase. Just adding the JAR to the classpath doesn't add enough information to apply any verification.

Alternatively, I could have a complete codebase using the architecture style, remove the annotations, and the test would likely still pass, despite the annotations being gone, and nothing enforcing i.e. Onion rings?

Exactly, because you do not describe where the rings are anymore.

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

No branches or pull requests

2 participants