synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <>
Subject Re: Simplifying the use of Quartz
Date Mon, 06 Aug 2007 16:35:00 GMT
> Here is a proposed XML:
> <job class="">
>    <property name="stringProp" value="String"/>
>    <property name="xmlProp">
>       <somexml>config</somexml>
>    </property>
>    <simpletrigger count="-1" interval="1000"/>
>    <crontrigger expression="0 * 1 * * ?"/>
> </job>

I did some research on XML design guidelines for
a presentation last year. While the element vs.
attribute decisions are somehow tricky, there
is one rule for which I found no contradiction:

> Don't put structured content into an attribute.

Based on that rule, the <crontrigger expression="..."/>
looks pretty bad. So if you prefer the attribute
approach to keep handcrafting of the XML files
simple, I would suggest to split the expression
into separate attributes:

<crontrigger minute="0" hour="*" dayofweek="1"
         dayofmonth="*" month="?" />

This would also allow users to specify only
the relevant attributes, like:

<crontrigger hour="*" dayofweek="1" />

For what it's worth, the best rule on element vs.
attribute I found was:

> Put data into elements, metadata into attributes.

But if the rest of your XML schema favors attributes
over elements, it's better to keep it consistent.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message