Monday, August 22, 2005

Spring/Hibernate Training 3

A simpler way to define properties

The spirng xml context files are, well, xml, so they can be verbose at times. One of the worst offenders is for defining properties:

<properties name="myProperties">
<props>
<prop key="myFirstKey">myFirstValue</prop>
<prop key="mySecondKey">mySecondValue</prop>
</props>
</properties>

The same properties can be expressed as this:

<properties name="myProperties">
<value>
myFirstKey=myFirstValue
mySecondKey=mySecondValue
</value>
</properties>

That's much better, isn't it?

0 Comments:

Post a Comment

<< Home