Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #22962
| From | Arved Sandstrom <asandstrom2@eastlink.ca> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: regexp(ing) Backus-Naurish expressions ... |
| References | (1 earlier) <5140fb94$0$32106$14726298@news.sunsite.dk> <sy70t.279596$EO2.53348@newsfe04.iad> <5142766c$0$32106$14726298@news.sunsite.dk> <VTB0t.60721$sI3.36935@newsfe22.iad> <14264c4a-b2de-4580-a065-9bc8e2218ee0@googlegroups.com> |
| Message-ID | <XZN0t.14574$Nl5.9348@newsfe07.iad> (permalink) |
| Organization | Public Usenet Newsgroup Access |
| Date | 2013-03-15 20:17 -0300 |
On 03/15/2013 03:34 PM, Lew wrote:
> I was happy to merely observe this variation on Editor Wars, but there are a couple of points
> I'd like to offer.
>
> Arved Sandstrom wrote:
>> How much does that schema and XML parsing save you? Presumably you want
>
> A lot, in my experience. I've done a fair amount of heterogenous-system communications
> via various protocols including fixed-format ("columns 1-6 mean identifier, 7-8 are a control code,
> 9-15 are the section name, ..."), CSV, XML, Google Buffers and JSON.
I agree, a lot *overall*. But I am thinking in this thread of
configuration files, strictly configuration files, and *only*
configuration files. That I use XML a great deal is totally irrelevant.
> Using XML for, say, web services or to communicate an object model is quite powerful, made
> more so by the use of schemas and schema validation.
It is that, although I wouldn't consider XML to be superior to other
possibilities for communication of object models. It works; so do other
methods.
> It doesn't handle deep validation, nor should it. It's the XML equivalent of surface-edit validation
> in a GUI. You don't expect the back end to validate everything, typically, but to count on certain
> sanity checks from the front end. Thus it is common for the front end (GUI widget or XML doc)
> to validate things like "is this a number?". And useful.
Well, yes. What I said.
>> those properties to end up in one or more strongly typed "properties"
>> objects. Whether the source of properties is a properties file or XML,
>> you have to code up those Java "properties" POJOs with full knowledge of
>> expected structure. *That* is your schema right there, regardless:
>
> That is not your schema. That is one layer's implementation of your schema.
Oh no, I disagree. That is my schema, if my source of truth is a Java
POJO. I didn't say "XML schema", I said "schema". The only thing that
concerns me in this argument is
POJO <-> configuration file
I know what I need that "properties" or "configuration" POJO to be; I
can write it first, it's authoritative. It *is* my schema. Not an XML
schema, but my expressed configuration data structure.
>> running an XML validator on an XML file against an XML schema is
>> duplication of effort. You'd learn the same things by failing to load
>
> Not if you do it right, it isn't.
>
>> the properties into your beans, which you have to do anyway.
>
> Not if you do it right, you don't.
>
> Systems have different pipelines at different layers. In a system where XML is
> advantageous, you have validation at the gateway, before it gets into your queues
> and components and heavy logic. This increases throughput and scalability in addition
> to correctness and reliability.
>
> Also, redundant checks are not always a bad thing. Back in the 1970s a nuclear
> missile siloed in West Virginia lost three of its four failsafes. Had there not been redundancy,
> there would have been catastrophe. Back in the 1980s there was a nuclear-medicine
> radiation-doser manufacturer in Canada who removed "redundant" hardware failsafes in the
> dosage, and the software bugs promptly started killing people.
>
> A properly designed system will put surface edits in the front end, whether it's XML or
> source code compilation or JSON parsing or what-have-you, and different checks in
> different layers. Useful redundancy is achieved by dependent layers asserting the validity
> promised by antecedent layers rather than duplication of all the effort.
>
This is a good argument - validation redundancy - in the bigger picture.
I don't dispute that. But you don't need XML or XML DTDs/schemas to
achieve that.
AHS
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
regexp(ing) Backus-Naurish expressions ... qwertmonkey@syberianoutpost.ru - 2013-03-13 21:54 +0000
Re: regexp(ing) Backus-Naurish expressions ... markspace <markspace@nospam.nospam> - 2013-03-13 15:12 -0700
Re: regexp(ing) Backus-Naurish expressions ... Arne Vajhøj <arne@vajhoej.dk> - 2013-03-13 18:20 -0400
Re: regexp(ing) Backus-Naurish expressions ... Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-03-13 20:00 -0300
Re: regexp(ing) Backus-Naurish expressions ... Arne Vajhøj <arne@vajhoej.dk> - 2013-03-14 21:16 -0400
Re: regexp(ing) Backus-Naurish expressions ... Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-03-15 06:31 -0300
Re: regexp(ing) Backus-Naurish expressions ... Lew <lewbloch@gmail.com> - 2013-03-15 11:34 -0700
Re: regexp(ing) Backus-Naurish expressions ... Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-03-15 20:17 -0300
Re: regexp(ing) Backus-Naurish expressions ... Leif Roar Moldskred <leifm@dimnakorr.com> - 2013-03-13 17:47 -0500
csiph-web