avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: XML Conventions
Date Sun, 08 Sep 2002 05:12:26 GMT
On Sun, 8 Sep 2002 14:49, David W. wrote:
> I tend to think of attributes as something you can identify the node with.
> Properties like displayName, description, and version can and will change
> over time, but if name and impl are the same, you probably haven't broken
> anything.  When you look through the entire XML file and you think, "That's
> the record for ____", you should make whatever value you use to identify
> the record (it's key basically) an attribute.  Okay, now I think I've
> figured out what I'm trying to say.
>
> The mental database approach: make something an attribute if you might want
> to seach for it or use it as an identifier (after all, 'component' doesn't
> tell you anything).

I like. So say wwe were going to declare a dependency of one component on 
another component. You would write it something like

<dependency key="some-service" type="o.a.a.SomeService" optional="true">
  <attributes>
    <attribute name="secure" value="true"/>
  </attributes>
</dependency>

Which saids that a dependency of type SomeService, looked up using key 
"some-service" is optional. It also has extra metadata associated with it 
indicating that it must be the "secure" version of this service.

Any other changes you would make?

-- 
Cheers,

Peter Donald
 "Man's mind stretched to a new idea never goes back to its original 
dimensions." -Oliver Wendell Holmes 


--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message