I am new to Spring MVC.I am learning the concept of dependency Injection.I am following this link for the code example of Spring using dependency Injection.
In that example i was very clear of the concept of dependency Injection. But i have a small question on how to tell Spring that i want to use multiple shapes. In that First example (Constructor based) he gave a reference to a Circle Object so that it draws a circle.
<bean id="geometryExample1" class="com.boraji.tutorail.spring.GeometryExample1">
<constructor-arg ref="circleShape"/>
</bean>
But what if want to draw both Circle,Rectangle and other Shapes? how do i tell or configure in Spring that depending on what shape i have provided it should use the approriate shape to draw the shape.
Any help is appreciated. Thanks in advance. Any suggestions?