Modelling Spring Boot Components #343
Replies: 3 comments
-
It sounds like your component finder strategy isn't finding all of the supporting types for the component, so the dependencies are not being found as a result.
|
Beta Was this translation helpful? Give feedback.
-
Hi Sorry - I must be missing something. I've put my sample project on GitHub at https://github.com/carljonescf/c4-test. The C4 code is in test/...generateModel.java. It's fairly standard Spring Boot (controller -> service -> serviceImpl -> repository -> repositoryImpl). I'm finding all of the components (both interfaces and classes), but the inter-component dependencies aren't showing. I've tried varying the supporting strategies, but none of them seem to make a difference. This is almost certainly driver-error so sorry for pestering you. |
Beta Was this translation helpful? Give feedback.
-
UPDATEThe last commit produces the output that I might expect. To do this, I...
If I use the same code with a flat package structure, I get some extra relationships in the model. |
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions