Posts

Showing posts with the label alias

Overriding Spring Beans with Aliases

Image
The most common approach followed for overriding a spring bean is to define a new bean, with the same id as the original bean, in a separate XML file. During context initialization, Spring would register the last bean found for the id, and use it for all the injections. I dislike this approach for two reasons.