[cad-linux-dev] entity 'ID' attribute: what's it for?

  • From: Bruno Postle <bruno@xxxxxxxxxx>
  • To: CAD linux development <cad-linux-dev@xxxxxxxxxxxxx>
  • Date: Tue, 7 Sep 2004 12:58:35 +0100

I notice from the example yaml files created so-far that each of the 
entities has an 'ID' attribute.

What I mean is that if a file is called "23.yml", it also has an 
"ID: 23" field internally.

Why is this?  Surely an object doesn't need to know its own address, 
the software accessing-it knows already.

This could cause problems, for example:

-  It would be impossible to clone an element in a drawing by doing 
   a straight filesystem copy - The copying tool would have to 
   fiddle with the file internals as well.

-  Same problem with renaming.

-  It would be difficult to reuse an element via hard-links (I'm not 
   sure I really want to do this though).

Also, all the elements so far have numeric (integer) filenames/IDs.
Is this intended to be part of the spec?

This makes sense with data imported from an existing dwg file, but 
isn't much use if you intend to access the data concurrently with 
two different applications or one multi-threaded application.  There 
are only so many integers available and locking the whole directory 
when creating new files would be horrible.

-- 
Bruno

Other related posts: