Setting up TangleGuard
TanlgeGuard is the place for you see all visualizations and where you can configure and document your architecture.
When opening TangleGuard for a specific codebase for the first time, it will create a configuration file. Add this file to your repository. It is supposed to be committed.
-
Integrate packages You need to integrate specific or all packages of your workspace into the system.
-
Define Layers Then define some layers and add packages to those layers.
-
Define rules You probably want to define some rules for the layers you defined, like layerX is allowed to depend on layerY.
-
Validate Then you can run violation checks and see if the codebase is aligned with the targeted design.
First, Define your Architecture
Section titled “First, Define your Architecture”To be able to detect architecture erosion, TangeGuard needs to know about your target architecture. You can define the goals and building groups of your application via a nice UI. Choose the path to a Cargo workspace.
When you select a workspace for the first time with TangleGuard, it will create a configuration file for you. Any configuration you make will be stored in that file. Please add the configuration file into the your Git repository.
Define Layers
Section titled “Define Layers”Layers should be the fundamental building blocks of your architecture. They are a high-level building block. The can group packages.
Add packages to the layers
Section titled “Add packages to the layers”The next step would be to add packages to the layers. To do that, the packages need to be integrated first. See settings -> Packages in the side nav.
Within the architecture settings, you’ll find a list of packages which are not yet associated with any layer. Click on the package to add it to a layer.
Define Rules
Section titled “Define Rules”Set rules for dependencies between layers. Soon you’ll be able to declare dependency rules between packages, too!
Now everything is set up and you can start validating your architecture.
Then, Validate your Architecture regularly
Section titled “Then, Validate your Architecture regularly”The dependency rule section will show you all rule violations in your source code, based on your defined rules. TangleGuard traverses your source code and check the dependencies against the rules.
Once a violation is found, it can be fixed. There will be no violation when the fix comply with the architecture rules. It could also be sufficient to apply changes in the rule system.