117
Asthedocumentandhistorybecomelarger,however,linearscanning(anditsO(N)run-
timeforadocumentcontainingNchanges)islessappealing.Onegoodstrategyistocache
versionsbyconstructingaseparateaccessstructurecontainingonlyinformationfromapar-
ticularversion.Cachedversionscancontaininformationononeversionorseveral.Alarge
numberofstrategiescanbeusedtocreatecachedversions:
Anewcachecanbecreatedforeachnewversion.
Anewcachevbecreatedperiodicallyforwheneveracertainnumberofversionshas
beencreatedonacertainlineofdevelopment.
Acachecanbekeptforthemostrecentversionsonsomesetofbranchesoftheversion
tree.
Cachesincludetheirdatabyreference,sothatacachedversionhasasizerelatedtothe
numberofoperationscontributingtoit,notthesizeofthesequenceitrepresents.Since
versionsareimmutable,noupdateissuesneedtobeconsidered,andcachedversionscanbe
deletedatanytime.Acachedversioncan,however,speedupdatessignificantlyifitmain-
tainspointersbacktothefulldatastructure,byallowingthecorrectlocationfornewup-
datestobefoundinthesmallercachedstructure,ratherthanthefullstructure.
Whilecachingcanspeedtheretrievalofaversion,acachethatisalsoalinearlistdoes
notprovideforquickaccesstoaparticularpointwithinaversion.ForthecurrentVTMLim-
plementation,thisisnotaseriousproblem,becauseofitstargetenvironmentofserver-
basedaccessovertheWorldWideWeb.VTMLfileswithmanyversionsresideatserverma-
chines,notuserworkstations.
6.3 ImplementingPalimpsest
IncontrasttoVTML,whichisintendedasaclient-servercommunicationformat,Palimp-
sestchangestructuresareforusebylocalinstancesofcollaborativeapplications.Becauseit
musthandleonlineupdatesatindividualeditorinstances,aPalimpsestdatastructuremust
118
supportawiderrangeofaccessandupdateoperations.Interactiveeditorsneedrandomac-
cesstosupportnavigationandtobeabletoretrievesmallerportionsofthesequencetofill
screenbuffers.Applicationsneedtoregisteruseractionsandremoteupdates,incrementally
addingchangestochangesetsrepresentingP-sequences.Finally,supportforsingle-or
multi-userundomeanssupportfortheincrementalremovalofachangefromachangeset.
GivenachangesetU,theuniverse,containingallchangesknownataninstanceofan
application,andchangesetsV
1 , …, V
n ˝ U,weareinterestedinsupportingthefollowing
capabilities:
1. Add(c,U):AddachangectoU.
2. LookupChange(ID,U):findallinformationaboutachangeinU.
3. FetchRange(a
1 , a
2 ,V
i ):Retrievethecontentsofarange(a
1 , a
2 )insomechangesetV
i .
4. AddChange(c, V
i ):UpdateachangesetV
i byaddingachangec.
5. DeleteChange(c, V
i ):UpdateachangesetV
i byremovingachangecfromit.
6. CreateChangeset(c
1 , …, c
k ):CreateanewchangesetV
i fromasetofchanges{c
1 , …,
c
k }.
AswithVTML,wewillassumethatchangesetsareexplicitlyrepresentedobjects:thiswill
allowustobuildincrementalindicesincludingonlytheoperationsinthoseversions,thus
speedingoverallperformance.Thisstrategyallowsustokeeptheruntimedependentonthe
numberofchangesinaversion,ratherthanthetotalnumberofchangesintheuniverse.
Thisispotentiallyausefulsavings,becauseoftheeffectsofuserundoactionsandthose
madetoresolvemergeconflicts.Thesearelikelytoleadtotheremovalofsomeoperations
fromallactiveversionsofinteresttotheuser(andtheseoperationsarealsocandidatesfor
garbagecollection).
TheP-sequencesdefinedbyparticularV
i representthecontentsofsignificantversions.
Theseversionsmaybepermanentrecordsofhistoricalstates,asinatraditionalversioning
system.Alternatively,theymayrepresenttheworkingstateofanapplicationwhichisman-
Previous Page Next Page