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

  • From: "Jim parker" <jparker@xxxxxxxxxxxx>
  • To: <cad-linux-dev@xxxxxxxxxxxxx>, <ewilhelm@xxxxxxxxxxxxx>
  • Date: Tue, 07 Sep 2004 10:28:56 -0400

How do you propose to accomplish undo and version control ?


H. James Parker
Naval Architect
Gibbs and Cox, Inc.
office)  703-416-3625
fax)      703-416-3679
jparker@xxxxxxxxxxxx
***********************************************
This e-mail and any attachments contain privileged, business sensitive,
and/or proprietary information.  The information is intended to be for 
the use of the individual or entity named.  If you are not the intended
recipient, be aware that any disclosure, copying, distribution or use of
this information is prohibited. If you have received this electronic
transmission in error, please immediately notify the Gibbs & Cox, Inc.
Security Supervisor at 703.416.1240 or via email at
Security@xxxxxxxxxxxxx
***********************************************

>>> ewilhelm@xxxxxxxxxxxxx 9/7/2004 9:59:11 AM >>>
# The following was supposedly scribed by
# Bruno Postle
# on Tuesday 07 September 2004 06:58 am:

>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.

No, that's what it was for.  This was intended to be used for audit 
purposes.  You're probably right though.  Having it in the file 
causes problems.

>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.

Right, or maybe a clone could be dynamic via symlinks.

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

Yes, do you have a different suggestion?

>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.

The important thing is to not re-use an ID when an element is deleted. 
 
I would like the ID to be persistent and unique for the life of the 
drawing.  Last I checked, the number-line went to infinity.  I never 
said it had to be allocated as an integer, just that it is 
mathematically an integer.

If that causes problems, should we mix in letters to have hex names, 
or use the whole [0-9,a-z] character-set as a 36-base number system?  
Either way, it still reduces to an integer.

I think we'll need a couple of files to handle the concurrent usage 
issue.  If two programs attempt to create entities with identical 
ID's simultaneously, how do they know what ID's to use?  Maybe each 
would lock a range of ID's?

With a database, row ID's are assigned as the rows are created, but in

that case there is a daemon in charge of them.  Maybe concurrent 
programs should connect to a socket for "next ID" information?  Could 
this be done cleanly with a single file?

--Eric
-- 
"...our schools have been scientifically designed to 
prevent overeducation from happening."
                                        --William Troy Harris


Other related posts: