comp.lang.ada
 help / color / mirror / Atom feed
* Re: Microsoft & Ada (and also a remark on DTDs prohibiting
@ 2004-09-13 13:37 Robert C. Leif
  2004-09-13 19:16 ` Georg Bauhaus
  0 siblings, 1 reply; 2+ messages in thread
From: Robert C. Leif @ 2004-09-13 13:37 UTC (permalink / raw)
  To: comp.lang.ada

   DTDs have a horrible syntax.  XML schema can be constructed to have
essentially a one-to-one correspondence to Ada.  Readability and strong
typing are very useful characteristics for software engineering.  My latest
work on medical data, CytometryML, can be found at
www.newportinstruments.com.  Most of the data types are NOT numeric.  In
fact, the major part of the numeric data is kept in separate files, which
are written in Ada.  My Ada code employs the same data-types and names as
the XML schema.
   Bob Leif
   
   Message: 1
   Date: Mon, 13 Sep 2004 10:01:14 +0000 (UTC)
   From: Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de>
   Subject: Re: Microsoft & Ada (and also a remark on DTDs prohibiting
   	economic	success)
   To: comp.lang.ada@ada-france.org
   Message-ID: <ci3r5a$dro$2@a1-hrz.uni-duisburg.de>
   
   Robert C. Leif <rleif@rleif.com> wrote:
   :   Any one of the present competitors
   : could have stopped Microsoft, if they made reliable well engineered
   : products.  Instead the competitors use Java and XML DTDs.  When the
economy
   : functions correctly, stupid business men go broke.
   
   I think it's not very smart to judge XML DTDs by narrowing one's
   view down to records numeric medical data. 8-) Likewise, rockstable
   proven software without much need to manually debug data streams can
   profit from the use of a scheme like ASN.1.
   
   -- Georg




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Microsoft & Ada (and also a remark on DTDs prohibiting
  2004-09-13 13:37 Microsoft & Ada (and also a remark on DTDs prohibiting Robert C. Leif
@ 2004-09-13 19:16 ` Georg Bauhaus
  0 siblings, 0 replies; 2+ messages in thread
From: Georg Bauhaus @ 2004-09-13 19:16 UTC (permalink / raw)


Robert C. Leif <rleif@rleif.com> wrote:
:   DTDs have a horrible syntax.

Care to elaborate?

: XML schema can be constructed to have
: essentially a one-to-one correspondence to Ada.

In essence, Schema definitions can be more specific about a mapping of XML
text to a subset of record types, enums, and some string types, if you
neglect Unicode (how many Characters do you need for a 64 character Unicode
String in Ada?).  More advanced XML element types (for example recursive
XML element types) are not that easily mapped to Ada records.

: Readability and strong
: typing are very useful characteristics for software engineering.

Right.  Which is why I prefer a clear Content Model notation, which
in case of DTDs is based on well established ways of writing regular
grammars.  (Using: () for grouping, | for alternatives, * for any,
+ for at least one. Is there any Schema author who doesn't know these?)

Paraphrasing definitions from you Schema files, consider


<!ELEMENT
	 Reactive_Functionality_Name    (#PCDATA) >

<!ATTLIST
	 Reactive_Functionality_Name

   Reactive_Functionality_Num
	(Unfuctionalized | mono | di | tri)       #REQUIRED
>


This DTD definition looses the information given in the Schema that the
element content must be a normalized string (IOW, a normalized attribute
value...) of at least 64 Unicode characters, as per your definition
of Bd_64_Type.  (Is "Unfuctionalized" a typo?)

But are these declarations written in a horrible syntax?
I can see no significant difference of the above enumeration from

  type Reactive_Functionality_Num is
        (Unfuctionalized , mono , di , tri);

On the whole I think what you have tried is to map some internal
data representation 1:1 onto an external XML Schema. Good idea?

:  Most of the data types are NOT numeric.

(OK, let me call them punch card data, as in fact there are also names
and hex numbers separated by ',', and more. Nothing wrong with punch
cards, if they matter.)

: My Ada code employs the same data-types and names as
: the XML schema.

Can this be a mistake? I think there are situations where this is
a mistake. It misses an opportunity to abstract from the bounds
of the machines. Make a "logical" format. For example, one of your
Schema types specifies

  hex-num-of-four-digits COMMA hex-num-of-four-digits .

via

  [0-9a-fA-F]{4},[0-9a-fA-F]{4}.

Doesn't this lend itself well to a definition that names the two
hex numbers? Like in

  <Complex  re="0.0" im="-1.0"/>

These are still Ada names, but it should be obvious what is meant
even if you do not know Ada.

"Pattern matching is not parsing." (SNOBOL4 saying.)


regards,
-- Georg



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-13 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-13 13:37 Microsoft & Ada (and also a remark on DTDs prohibiting Robert C. Leif
2004-09-13 19:16 ` Georg Bauhaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox