The following steps describe how a basic architecture check can be implemented using the Domain Specific Language (DSL):
-
Create a new architecture file "layers" by right-clicking on the folder "Architecture" in the Files view. Keep the default options and make this architecture file "checked".
-
Create artifacts "Business", "Integration", "Foundation" with the standard include patterns. Check the context help ( F1 ) for more information.
-
Right-click on the file in the Architecture Files view and open the Exploration view for the architecture model. You should see red arcs representing violations.
-
Connect artifact "Business" with "Integration".
-
Make "Foundation" public, so that it is implicitly accessible by the other artifacts.
-
Save the changes and check in the Architecture view that the correct components are matched for the artifacts. Verify that the architecture-based Exploration view does not show any violations.
-
Create new checked architecture file "application". Create artifacts "Startup", "Application" (**/ddaexample/**), Framework (**/dda/**) with the standard include patterns. Connect the artifacts as indicated by the existing dependencies (use the Exploration view).
-
Use the "apply" statement for "Application" and "Framework" to create the layering defined previously in "layers.arc".
-
Add the "optional" keyword to the "Foundation" artifact in layers.arc to get rid of the "Empty artifact" warning.
-
Create the checked architecture file "component". Create artifacts "Controller", "Data", "Domain", etc that correspond with the packages in the code.
-
Create the connections as the dependencies in the code indicate. Again, use the Exploration view to check for the existing dependencies.
-
Check for architecture violations in the Issues view. Drill-down to the code and examine the root cause for the violations.
-
Remove "layers.arc" from the list of checked architecture files. It is now implicitly used, since the layering is checked and applied in the file "application.arc".
-
An architecture can also be interactively modeled using the Architectural view. Create a new "Architectural View" and create the layering with it.
-
Export the information to an Architecture DSL file and observe the differences to the manually written architecture file.
End of Step 3 (step3_crm-domain-example.sonargraph).
Related topics: