structurizr / java

Structurizr for Java
https://docs.structurizr.com/java
Apache License 2.0
1.02k stars 290 forks source link

Modelling Spring Boot Components #342

Closed carljonescf closed 2 months ago

carljonescf commented 2 months ago

Question

Hi

Is there an example of how to use the new component library to model Spring applications? I remember that the old Spring library relied on the "impl" suffix as a naming standard.

I've got code that picks up all of the components, but it's struggling to pick up the right dependencies. It either picks up some, but not all, or too many (i.e. it links everything in the package) depending on the strategy that I pick.

I've tried creating my own naming strategy which removes the "Impl" from the name on the logic that if MenuController depends on MenuService, and MenuServiceImpl implements MenuService that if I match by the "Service" and "Controller" annotations, it would link the controller and the service. (I'd then repeat for service to repository relationships). NOTE: In my example, all of the components are in the same package.

Thanks in advance for any guidance.