after watching various tutorials and doing some reading I understand how to use constructor arguments in spring. no issue there.
my issue is can someone explain or point me to some material where it explains WHY they are used. what I mean by that, surely with syntax like this: <constructor-arg value="threading"></constructor-arg>
, a hardcoded value is poor practice?
i dont want an any articles on spring concerning how to do it. i just need a simple answer to explain why hardcoding is seemingly okay here OR better solutions. I am aware of the @Resource annotation which gets rid of the need for lines such as <property name="answer" ref="answer"></property>
but I have always been taught hardcoding is bad idea and pulling from a DB for example is a better solution
<bean id="questions" class="main.Questions">
<constructor-arg value="0000"></constructor-arg>
<constructor-arg value="What is the question?"></constructor-arg>
<constructor-arg value="threading"></constructor-arg>
<property name="correctAnswer" value="deadlock"></property>
</bean>