tags:

views:

87

answers:

1

Did Spring abandon YAML to use as an alternative to .properties / .xml because of:

[Spring Developer]: ...YAML was considered, but we thought that counting whitespace significant was a support nightmare in the making... [reference from spring forum]

I am confident YAML makes a lot of sense for properties, and I am using it currently on the project, but have difficulties to inject properties in a

<property name="productName" value="${client.product.name}" />

fashion.

Anything I am missing, or I should create a custom YamlPropertyPlaceholderConfigurer ?

Thank you,
/Anatoly

A: 

The forum post you reference was from the dmServer forum, rather than the Spring Framework, and there's very little relation between the two, so I wouldn't read anything into it.

On top of that, YAML is pretty much unheard of in the Java world, so adding support for it would have been a token gesture (if you'll pardon the expression) at best. XML dominates in Java, especially server-side, so there's little use in swimming against the tide there, especially for a minority format like YAML.

Having said that, writing your own YamlPropertyPlaceholderConfigurer should be easy enough, assuming you can find a YAML parser for Java.

skaffman
`JvYaml`, `SnakeYAML`, `YamlBeans`, `JYaml`, etc.. YAML is far from unheard of in the Java world, and people do use it [I guess the ones that don't use Spring].dmServer _is_ Spring, and although not the framework, but decisions are made by the pretty much the same circle of people [SpringSource is not a big "division" ~150 people]
litius