Skip to content

Commit

Permalink
Enhance user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
rweisleder committed May 29, 2024
1 parent 9cbfbe1 commit b3a3c45
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/main/docs/userguide.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
:toc:
:toc-placement!:

= ArchUnit Spring Integration

The ArchUnit Spring Integration provides predefined https://github.com/TNG/ArchUnit[ArchUnit] rules for https://spring.io/projects[Spring] applications.

toc::[]

== Overview

The <<builtin-rules,built-in rules>> help you to avoid typical problems when developing Spring applications that would otherwise lead to unexpected behavior.
Expand Down Expand Up @@ -112,6 +117,36 @@ Such internal calls bypass Spring's proxy mechanism, causing the intended cachin

This rule should only be used if caching is used in proxy mode (which is the default mode), see the `@EnableCaching` annotation.

==== SpringComponentPredicates

The class `SpringComponentPredicates` contains predefined predicates to match the different Spring stereotypes like `@Controller`, `@Service` and `@Repository`.

==== SpringComponentRules

===== Rule DependenciesOfControllers

The rule `SpringComponentRules.DependenciesOfControllers` ensures that all controller classes only depend on service classes or repository classes.
They should not depend on other controller classes or configuration classes.

===== Rule DependenciesOfServices

The rule `SpringComponentRules.DependenciesOfServices` ensures that all service classes only depend on other service classes or repository classes.
They should not depend on controller classes or configuration classes.

===== Rule DependenciesOfRepositories

The rule `SpringComponentRules.DependenciesOfRepositories` ensures that all repository classes only depend on other repository classes.
They should not depend on controller classes, service classes, or configuration classes.

=== Spring Boot

==== SpringBootRules

===== Rule AllTypesInApplicationPackage

The rule `SpringBootRules.AllTypesInApplicationPackage` checks that all classes are located in the same package or a sub-package of the application class.
The application class is the one annotated with `@SpringBootApplication` or `@SpringBootConfiguration`.

== Compatibility and Support

=== Open Source Edition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
import static de.rweisleder.archunit.spring.framework.SpringProxyRules.beProxyable;
import static de.rweisleder.archunit.spring.framework.SpringProxyRules.notBeCalledFromWithinTheSameClass;

/**
* Collection of {@link ArchRule rules} that can be used to check the usage
* of Spring's support for asynchronous method execution.
*
* @author Roland Weisleder
*/
public final class SpringAsyncRules {

private SpringAsyncRules() {
Expand Down

0 comments on commit b3a3c45

Please sign in to comment.