r/SpringBoot • • 25d ago

Discussion Sequence diagrams that follow @Autowired to the bean Spring actually injects

Most call graph tools stop at the interface. You call orderService.place() and the diagram shows OrderService, not the class doing the work.

Call Sketch is a JetBrains plugin I built, and its Pro version follows the Spring wiring to the real bean. It also draws if/else and loop boxes, so you see when a call happens and not only that it does.

Free version covers Java and Kotlin with any depth and click to jump to code. Pro is $7 a year with a 30-day trial.

https://plugins.jetbrains.com/plugin/35865-call-sketch-sequence-diagrams

2 Upvotes

6 comments sorted by

3

u/nico-strecker 25d ago

Doesn't intellijs integrated spring boot plugin do that already?

0

u/Fuad_Laguda 25d ago

It takes you to the bean, but it doesn't draw the calls. Call Sketch draws the whole chain as a sequence diagram and follows the real bean instead of stopping at the interface.

1

u/as5777 25d ago

@Autowired ?!

I think it’s deprecated since spring 4 or 5, at least not recommanded to use it

2

u/Fuad_Laguda 25d ago

Not deprecated, but you're right that constructor injection is the way to go now. Call Sketch handles both, field or constructor, with or without the annotation. I just used Autowired as the shorthand.

1

u/Resident-Cow-7626 22d ago

Autowired isn’t a shorthand. It does instance variable based injection and is discouraged.

1

u/Fuad_Laguda 22d ago

Fair point, that was loose wording on my part. I meant Spring's injection in general, not field injection. Call Sketch follows constructor injection the same way, and that's what most code uses now.