114
tainingtothatdocument.AVTMLserverregistersandassignsfinalversionnumbers,main-
tainsthesharedstate(consistingofarepresentationofallversions),andintegratesthe
changessubmittedbycollaborators.
Therearethreeimportantvarietiesofexternalchange,externalinsertions,externaldele-
tionsandusrops.Externalinsertionsindicateaversioninwhichthechangetakeseffect,a
location(intheformofabaseversionandanoffset),andastringofbytestobeinsertedat
thatlocation.Externaldeletionsconsistoftwoaddressesdelimitedarangetobedeletedin
thedeletion’sversion.
TheusropdeclarationsinaVTMLfileprovideVTML’schangeorientation,byspecifying
additionalchangestobeexplicitlyincludedin,orremovedfrom,anyversioninwhichthey
apply.Usroptagsprovidetheabilitytoconstructarbitraryversionsfromindividualchanges.
VTMLimposesaconstraintsimilartoPalimpsest’snotionofcausalconsistency.Aninsertion
thatisaddedtoabaseversiononlytakeseffectifthecontextinwhichthatinsertionwas
insertedisalsopartoftheresultversion.
ThesecondportionofaPalimpsestfileconsistsofinternalchanges,storedinsequence
justliketheaddressspaceofachangesetcontainingonlyinsertanddeleteoperations.Each
insertionoperationisrepresentedbytwotagsthatopenandcloseitsregionofeffect.All
datainsertedbythatchangeappearsanywherebetweenitstags.Insertionsmaynestarbi-
trarily.Deletionsarealsorepresentedbystart-andend-tags,buttheyarenotconstrained
byanynestingrequirementasinsertionsare.Thetagsofdeletionsareco-indexedbythe
valueoftheirchangeIDattributes.
AveryshortexampleVTMLfileisshowninFigure6.1.Itrepresentsafilewith4ver-
sions.Version0.0isanullversioncreatedbymyprototypeVTMLeditorwhenthefileitself
wascreated.Version1.0containsthetext“Thisisasimpleexample.”Therearetwosucces-
sorversionstoversion1.0.Version2.0wascreatedfirstandnumericallysucceedsversion
1.0.Change2ofversion2.0isadeletionthatremovestheword“simple”fromthetext.
115
Change3ofversion2.0insertstheword“complex”intheplacepreviouslyoccupiedby
“simple”.Version2.1isanalternativesuccessortoversion1.0,whichalsodeletes“simple”
butreplacesitwith“confusing”instead(viachange2ofversion2.1).
((vtml"1.0"base="2.1"))
((ins"0.0")
((ins"1.0#1"pos="0"base="1.0")Thisisa
((adel"2.0#2"base="2.0"))
((ins"2.1#2"base="2.1")confusing((adel"2.1#1"
base="2.1"))
simple((adelend"2.1#1"))((adelend"2.0#2"))
((ins"2.0#3")complex)
example.))
F F F F iii ig g g gu u u ur r r re e e e 6666....1111:::: VVVVTTTTMMMMLLLL eeeexxxxaaaammmmpppplllleeee sssshhhhoooowwwwiiiinnnngggg iiiinnnntttteeeerrrrnnnnaaaallll cccchhhhaaaannnnggggeeeessss
ThedetailsofVTMLsyntaxaside,themostimportantfactoristhattheinternalchange
formatisalsosupplementedbyanexternalchangeformatthatallowschangestobere-
cordedseparatelyfromthebasedocument.
((vtml"1.0"base="2.1")
((extinsbase="2.1.1"pos="0")Thefollowingwaswrittenbydgd:))
F F F F iii ig g g gu u u ur r r re e e e 6666....2222:::: VVVVTTTTMMMMLLLL eeeexxxxaaaammmmpppplllleeee sssshhhhoooowwwwiiiinnnngggg eeeexxxxtttteeeerrrrnnnnaaaallll cccchhhhaaaannnnggggeeeessss
Figure6.2showsanextremelyshortVTMLdocumentrepresentinganupdatetothefile
above.Itconsistsofasinglechangeaddinganattributiontothetextpreviouslyentered.
Whileanentiredocumentcanbestoredintheformofexternalchanges,theyaremostuse-
fulforexpressingthedifferencesbetweenversionsorupdatesmadebyaneditingprogram.
InasystemusingVTML,asinoneusingPalimpsest,itispossibleforaddressescreatedat
differentlocationstoconflict.InVTMLsystems,however,acentralservercanintegrate
separatechanges,determiningthefinalresults.
6.2 ImplementingVTML
ThebasicideainimplementingVTMListokeepastructurefromwhichthecontentsofa
documentcanbeeasilyretrieved.Thesimpleststructureisalinearlistcontainingeach
chunkofdata,starttagandendtagintheVTMLdocument,inorder.Aprogramcantraverse
Previous Page Next Page