spring-modulith icon indicating copy to clipboard operation
spring-modulith copied to clipboard

Create Sonargraph architecture model from Spring Modulith's application module model

Open odrotbohm opened this issue 9 months ago • 1 comments
trafficstars

Sonargraph is a software quality tool that heavily inspired practices enforced by Spring Modulith. It allows architects to define an intended architecture, verify that against a codebase, perform virtual refactorings and (visually) explore the effects on the architectural quality of those.

Working with Sonargraph usually starts with defining the logical architecture in a DSL. With Spring Modulith in place, a lot of the structural information needed for that can be found in the codebase itself. We could allow creating such a skeleton architectural description through the Documenter API and inspect our ApplicationModules.

artifact $module.displayName {

  include $asPath($module.basePackage)

  // For each nested module
  exclude $asPath($nestedmodule.basePackage)

  // For each named interface
  interface $ni.name {
    /For each type
    include $type
  }
}

I guess we could also register all allowed dependencies declared by application modules or fallback to the currently existing ones if none are declared explicitly.

odrotbohm avatar Feb 07 '25 11:02 odrotbohm

Upvoting this

patpatpat123 avatar Feb 08 '25 16:02 patpatpat123