Injecting @Beans from within a very same @Configuration class idioms

Does Spring process the whole instantiation method in each call for IDIOM 1?

No, This is called inter-bean dependencies, a method that annotated with @Bean annotation in @Configuration class will create a bean in spring IOC container

The @Bean annotation is used to indicate that a method instantiates, configures and initializes a new object to be managed by the Spring IoC container. For those familiar with Spring's XML configuration the @Bean annotation plays the same role as the element. You can use @Bean annotated methods with any Spring @Component, however, they are most often used with @Configuration beans.


Does otherwise Spring inject the global managed instance when injecting for IDIOM 1?

Yes, spring injects the same bean if it is required at multiple places Basic concepts: @Bean and @Configuration This inter-bean dependencies will only work in combination of @Bean and @Configuration which also prevents calling same bean method multiple times.

Only using @Bean methods within @Configuration classes is a recommended approach of ensuring that 'full' mode is always used. This will prevent the same @Bean method from accidentally being invoked multiple times and helps to reduce subtle bugs that can be hard to track down when operating in 'lite' mode.


Does Spring process the whole instantiation method in each call for IDIOM 1? (relevant if method has any side-effect, might be not idempotent)?

By default @Configuration classes are proxied at runtime so the MyBeanDependencyA will be created once and myBeanDependencyA() will be called only once by Spring and next calls will be proxied to return the same instance (as far as example that you shared is concerned). There will be only one instance of this bean in the context as it's scope is Singleton.


Does otherwise Spring inject the global managed instance when injecting for IDIOM 1? (relevant If some external process changes the state of the original singleton bean)

The IOC container will return same instance of Singleton bean when it is queried to do so. Since it is a Singleton all changes to this bean (if it is mutable) will be visible to components that have reference to it.


As a side note you can disable autoproxing of configuration class since Spring 5.2 by using :

@Configuration(proxyBeanMethods = false)

which will prevent proxying calls of methods annotated with @Bean invoked from other @Bean methods.