[cad-linux] Re: An open CAD file format

  • From: Massimiliano Mirra <mmirra@xxxxxxxxx>
  • To: cad-linux@xxxxxxxxxxxxx
  • Date: Sun, 07 Sep 2003 20:30:16 +0200

Eric Wilhelm <ewilhelm@xxxxxxxxxxxxx> writes:

> I'm talking about the programming interface here.  If everyone's program 
> interfaces directly with the filesystem and the text content of each file, 
> then everyone's program gets broken by a change in the design specification 
> for the file format.
>
> I'm sure you will never have to change your mind about the line format, but 
> more complex geometry exists (and you should probably never say never when 
> designing software.)

<aside> Eric, I am trying to learn something and you are providing
valuable point of views, for which I am grateful.  Shall we limit
discussion to technical in contents and ways?  Sarcasm does not help
learning and lack thereof certainly does not make your contributions
less valuable; if anything I write seems to deserve sarcasm please do
point it out, I'll gladly apologize, as I told you I am not a native
speaker and I might not always get the meaning through.  </aside>

Versioning is of course an issue and will have to be dealt with,
sooner or later.  A query/answer communication protocol is a good
solution, as long both parties agree on the protocol; once the
protocol changes, parties must relearn it, at least if they want to
make use of the changed/added parts.  Same goes for files, which is
frozen communication and relates to a communication protocol like a
spoken conversation relates to a letter.

Designing (or letting emerge through natural selection) a flexible
enough file format is probably not harder nor easier than designing a
flexible enough communication protocol in the same problem domain;
solutions exist as well as pitfalls.  The nice extensible format of
sexp's has been proposed; XML has been pointed as well, which after
all is decorated sexp's.  Both allow for selection of specific
understood data and let ignore the not understood one.  Associative
arrays are one more, lightweight, option, e.g. should a file be
organized like this:

    rectangle: 1 1 4 4
    line: 0 0 10 5
    circle: 35 30 2

...and a bash script only understands `rectangle' and `line', it can
just work on `rectangle' and `line' lines and leave the rest
untouched.


Massimiliano

p.s.: I'm leaving tomorrow for a week; replies will depend on
availability of e-mail.

Other related posts: