[jboss-as7-dev] Attributes versus attributes

David M. Lloyd david.lloyd at redhat.com
Mon Nov 28 13:26:39 EST 2011


In our management model we have the terms "resources" and "attributes", 
where resources are more or less defined as collections of attributes 
with an address.

In our configuration file, we use XML which includes "elements" and 
"attributes".  I've noticed that in many cases, subsystems have taken it 
as implied that a management attribute must be mapped directly to an XML 
attribute.  However, this is not the case.

In particular, our subsystem root XML elements should NOT have 
attributes on the <subsystem> element.  Due to the way that the XML 
namespace is declared, attributes on this XML element are hard to see 
and it may be confusing for users.

It is OK (and recommended even) to use nested XML elements for 
management attributes.  In particular we should always do this:

1) When declaring a subsystem top-level management attribute
2) When a nested management resource could, now or in the future, have 
more than one or two attributes

Stylistically, often the only time you should really have more than one 
XML attribute on an element is when you are dealing with a compound 
value such as a time unit where you have the unit and the quantity, and 
that sort of thing.

If you have created a subsystem element with top-level XML attributes, 
please take a moment to fix it so we can have a clean configuration file 
for CR1.  Thanks.

P.S. don't make me bust out the "git annotate"!
-- 
- DML


More information about the jboss-as7-dev mailing list