Hey

Emmanuel Pirsch wrote:
> You may gain a little for a little more consistence but you loose a lot in error
> report. You do not use the capability of XML DTD to validate an XML file.

Which becomes a non-issue if editors are used (mine is just finished and
will be released in a couple of days).

> Also I don't think thye constistence argument hold a lot.
> The description field is a complex object (in that case - a multiline String -
> -probably rich text) that is best represented by an element. But the Reentrant
> attribute is a simple object (true or false) that is best represented by an
> attribute.

But both Description and Reentrant are logical attributes of Entity,
hence it becomes confusing if different rules apply to them.

> I have a question for you. In your java program, do you use a base type to represent
> a boolean value or the Boolean object to represent the same value. If you wich to be
> constistent he will use Objects all over the place and never use base type. One may
> gain in consitency by doing this but will loose in effeciency also. The Java APIs do
> not use Objects all over the place for the sake of consistency.

I have used Strings only in my editor, but OTOH I use PropertyEditors
which only allow proper values (in the Boolean case a dropdown list with
"True" and "False").
When the validator is released (mentioned in the spec. if I recall
right) one could use it to do all semantics and syntax checking.

> This is the same for XML, by making eveything an element you gain in concistency, but
> you loose in effeciency, elegance and error validation.
>
> If you really want to use only elements, go for it but at least for something like
> the reentrant attribute do something like this:
> <!ELEMENT Reentrant (False|True)>
> <!ELEMENT False EMPTY>
> <!ELEMENT True EMPTY>

So the XML becomes:
<entity>
  <reentrant>
    <true/>
  </reentrant>
</entity>
----
Now, where's the elegance in that? The way it works now is fine IMO.

> That way at least you will gain a little in validation. But again you loose on
> effeciency because the resulting DOM tree will be a lot bigger.

My view is that validation can be done much better and with higher
control in Java-based editors, instead of trying to create messy XML
rules (is it even possible?).

Just my 2 cents...

/Rickard

--
Rickard �berg

Computer Science student@LiTH
@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to