Question 1
Topic: Spring Core
Skill tested: Configure Java-based beans with explicit dependencies and retrieve them from an application context.
A service is being split into Java configuration classes. `OrderService` requires an `InventoryClient`, and both beans must be managed by Spring. The application already loads `OrderConfiguration` through an `AnnotationConfigApplicationContext`; the team wants to keep construction explicit and avoid component scanning because only a small, reviewed set of types may be registered. Which change best satisfies the requirement?
Declaring both objects with `@Bean` methods keeps registration explicit, while a factory-method parameter lets Spring resolve and inject the `InventoryClient` bean. The context can then supply the managed `OrderService` by type. Component scanning in A violates the requirement to register only an explicitly reviewed set of types. C creates the client outside Spring management, which prevents independent configuration and lifecycle management. A shutdown hook in D manages context shutdown; it does not register ordinary objects as beans.