Re: [xml-dev] Michael Kay: simple designs make easy things easier,difficult things more difficult
From: John Cowan <johnwcowan@gmail.com>
To: "Costello, Roger L." <costello@mitre.org>
Date: Tue, 12 Nov 2013 09:41:00 -0500
On Tue, Nov 12, 2013 at 7:36 AM, Costello, Roger L. <costello@mitre.org> wrote:
I am very interested in seeing concrete examples of a simple design making difficult things more difficult.
Does anyone have examples of this please?
I would express it this way:
A simple design is normally aligned to a fairly narrow set of use cases, and makes it difficult to impossible to handle other use cases. A complex design is either written in the first place to handle many use cases, or evolves out of a simple design when new use cases must be supported.
For example, plain XML has only one kind of simple content, and that's text. By layering XML Schema part 2 over XML, you can provide for many types of simple content. If you use DTLL (ISO 19757-5) or a third-generation programming language such as Java to write your own datatype library, you can provide an open-ended set of simple content types. You can, with a fair amount of pain, serialize almost any network of objects as schematized XML (not that I recommend doing it). But the resulting design is very complex.
JSON starts off with four types of simple content: numbers, strings, booleans, and null. There is no widely accepted mechanism for adding more simple types, either directly to the syntax or by layering. The simple design makes the use case of serializing objects more difficult, unless the objects are limited to holding the above four kinds of primitive data.