`singleton` (default) means one bean instance per Spring container. `prototype` means a new instance each time the bean is requested; for web apps you also have request/session scopes.
A bean scope controls *how many instances* Spring creates and *when*.
If you inject a prototype bean into a singleton bean, you still get **one instance** at injection time. If you need a fresh instance per use, inject a provider.
@Component
@Scope("prototype")
class TraceId { /* ... */ }
@Service
class OrderService {
private final ObjectProvider<TraceId> traceId;
OrderService(ObjectProvider<TraceId> traceId) { this.traceId = traceId; }
void handle() {
TraceId id = traceId.getObject(); // fresh instance
}
}