XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Help with XML anti pattern

At 2021-11-24 11:56 -0500, William David Velasquez wrote:
Thanks everybody for your insightful ideas.

Ken, I'm particularly interested in your opinion because extensibility should be a very common requirement in UBL implementations.

Do you have knowledge of what other approaches have been used with UBL for reaching such extensibility?
I do not. In the committee we solicit the community to tell us through the Public Comment List [1] their requests for what they need to see in future versions of UBL for semantics they want to support but are not governed elsewhere. We expected these to show up in extensions. Then we would decide if we bake those semantics into the specification, or leave it with the community to continue using extensions.

No-one has brought forward any of their extensions for the committee to consider.

Perhaps this means that extensions are not used a lot. After all, UBL has 4000 elements for standardized semantic components. Users should not put into an extension point information that is found already in the standard.

It was anticipated that the extension point would be less for colloquial XML and more for XML that is standardized for semantics governed by other committees (so that we in UBL don't have to transcribe those semantics into UBL-specific elements). A good example of this is using the scaffolding to encapsulate W3C Digital Signatures ... we ended up including that right in the standard itself as the only standardized extension.

But think of any other committee's XML vocabulary that marks up a standardized set of semantics, and by using that in the UBL extension point, you've extended UBL to use those existing semantics.

Your client's contractor designed their use of the extension point very poorly. You could do better. Perhaps you can convince the client by pointing to the archive of this discussion.

Good luck!

. . . . . . . Ken

[1] https://lists.oasis-open.org/archives/ubl-comment/
You can register here to post to the list:
https://www.oasis-open.org/mlmanage/



El 2021-11-23 17:36, G. Ken Holman escribió:
Norman, I agree XML is not appropriate for name/value pairs, but I
worry your criticisms are misplaced.

If the context is such that there is a set of key-value pairs being serialised in this way, for in-principle arbitrary keys, then the conclusion may be that XML is a poor way of doing this serialisation.
Rather, name/value pairs are a poor choice of information
representation when using XML.
The requirement to use UBL ISO/IEC 19845 XML is not a "choice for the
serialization of name/value pairs" but is imposed in many
jurisdictions worldwide for the arm's-length exchange of serialized
semantic business objects of information between trading partners. The
governance of the international networks mandating UBL would not and
do not consider JSON as fit for purpose.
So the original poster is obliged to use XML and is asking for the
best way to use the XML. I believe the original poster is not asking
for alternative serialization syntaxes.

Use JSON instead (cf the discussion on this list in the last few weeks).
I believe JSON is inappropriate for arm's-length international
semantic content interchange and belongs only in tight bindings within
systems that are entirely under the control of the programmer.
UBL is used between disparate systems, with different internal
representations of the semantic content, and so XML is the ideal
syntax for bridging those systems. XML imposes no internal memory
representation of the content because users process the XML and
populate their own choices of internal representation.
My opinion on this is captured here:
https://www.linkedin.com/pulse/horses-courses-perspective-xml-vs-json-discussion-ken-holman
One might observe that the committee bowed to the community requesting
a JSON serialization of UBL, and the committee delivered it ... but
no-one I know of is actually using it. No governance would permit it.
And, technically, the JSON serialization has no UBL extension point
because of the lack of a JSON schema wild card validation constraint.

I think this is quite a good example of XML not being the right answer for every problem, and indeed this is the sort of solution that gives XML a bad name.
I feel your conclusion is misplaced.
The UBL extension point scaffolding is designed for containing the XML
representation of semantic content not standardized by the UBL
committee. It is up to users to choose what structures to put into the
UBL extension point as it is out of scope for the UBL committee. I
hate when it is used poorly, but the committee created it for open use
by users and this is good evidence of it being used poorly. And so I
worry your conclusion is focused on the use of XML syntax being a bad
choice rather than the use of structures chosen within the XML being a
bad choice. The bad information design shouldn't govern the syntax
choice ... the design should be fixed.
I would rephrase your paragraph as: I think this is quite a good
example of a poorly-chosen structure for the given syntax
serialization.
. . . . . . Ken
Disclaimer: take my words with a grain of salt because I am the editor
of the UBL Standard, the designer of the UBL extension point
scaffolding, and the author of the UBL JSON serialization. But I
welcome others to make their observations regarding your post.
At 2021-11-23 21:49 +0000, you wrote:

William, greetings.
On 23 Nov 2021, at 18:21, William David Velasquez wrote:

<ext:UBLExtension>
<ext:ExtensionContent>
<SWMaker>
<SWMakerInfo>
<Name>FirstName</Name>
<Value>Erick</Value>
<Name>LastName</Name>
<Value>Rich</Value>
<Name>SWName</Name>
<Value>FancySoft v.1.0</Value>
</SWMakerInfo>
</SWMaker>
</ext:ExtensionContent>
</ext:UBLExtension>
and

I'm expecting customer won't be open to accept the change, because the actual structure can do the work.
So, what arguments would you use to convince the customer?
One possible tack is to note that the key-value structure is highly unidiomatic XML, so XML tools will always work poorly with it (you're mentioned a couple of examples of what one might call 'impedance mismatches' already), and it is thus building in technical debt by design.
If the context is such that there is a set of key-value pairs being serialised in this way, for in-principle arbitrary keys, then the conclusion may be that XML is a poor way of doing this serialisation.
Use JSON instead (cf the discussion on this list in the last few weeks). I think this is quite a good example of XML not being the right answer for every problem, and indeed this is the sort of solution that gives XML a bad name.
If the conclusion is that there are key-value pairs, and this serialisation has got to have pointy brackets in it (kos that's what the kool kidz are doing these days), then potentially use plist format [1].
I don't think anyone believes that .plist was a good Apple design decision, but there are at least libraries for it, and no-one has to waste their good energies trying to put a different shade of lipstick on this particular pig.
I see that there's at least some 'ext:' XML namespacing happening there, so another one surely wouldn't hurt.
(I don't think <Name>/<Value> is a great design, by the way)
Best wishes,
Norman

[1] https://en.wikipedia.org/wiki/Property_list
--
Norman Gray : https://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK

--
Contact info, blog, articles, etc. http://www.CraneSoftwrights.com/x/ |
Check our site for free XML, XSLT, XSL-FO and UBL developer resources |
Streaming hands-on XSLT/XPath 2 training class @US$125 (5 hours free) |
Essays (UBL, XML, etc.) http://www.linkedin.com/today/author/gkholman |



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS