[sugar] Dependency Handling in the Journal

Benjamin M. Schwartz bmschwar
Fri Apr 13 17:50:39 EDT 2007


I posted this on the wiki, but I thought I'd mention it here.  I think the
journal should track inter-file dependencies.

Many files we create depend on other files.  The most common example is probably
documents that contain pictures.  In some document formats, these pictures are
copied into the document, and in others they are referenced by location.  To
avoid wasting storage space, we would like to insert pictures by reference
(like in .html or .dvi) rather than include them (like in a .pdf).

There are two major problems with inter-file dependencies: deletion and
transmission.  Without dependency awareness, it is easy to accidentally delete
a file (such as a picture) on which another file depends.  This is true whether
the deletion is automated or requested by the user.  Without dependency
awareness, it is easy to transmit a document that the recipient cannot use. 
Anyone who has been e-mailed an html file without the embedded pictures has
experienced this.

To avoid breaking dependencies, the metadata for each file should note the files
on which it depends. A dependency should never be suggested for deletion unless
all files that depend on it will also be deleted, and users should be warned if
they explicitly attempt to delete a dependency of another file.  Also, when a
student sends an item to another student (or to a teacher), all of its
dependencies should be sent with it automatically.

This scenario does not apply only to text with embedded pictures.  Other
examples might include a vector graphic with an embedded photograph, or a video
editing project that strings together a number of source clips.

I just thought I'd throw that out before all the APIs get finalized.

--Ben




More information about the Sugar-devel mailing list