procedure PropagateAsset(S, T, R, F):
sourceAssetType <- S.assetType
match on sourceAssetType
case FileType: Perform File Level Propagation
case ClassType: Perform Class Level Propagation
case MethodType: Perform Method Level Propagation
case BlockType:
end match
end procedure
procedure extractAssetTypeFromAsset(A, AT):
// this includes licence text, package definition, imports, etc.
listOfAssetType <- Assign empty List
for each item in A:
IF AT of item == AT THEN
add item to listOfAssetType
end IF
end for
return listOfAssetType
end procedure
procedure fileLevelPropagation(S, T):
// this includes licence text, package definition, imports, etc.
// includes addition and removal of methods, attributes, etc.
listOfSourceBlocks <- CALL extractAssetTypeFromAsset with S and BlockType
listOfSourceClasses <- CALL extractAssetTypeFromAsset with S and ClassType
// compares and merges new or changed BlockType assets from source to target
// wrapped in feature annotations
CALL mergeFileBlockInTarget with T and listOfSourceBlocks
// compares and merges new or changed ClassType assets from source to target also
// propagates children of classes via classLevelPropagation wrapped in feature annotations
CALL mergeFileClassInTarget with T and listOfSourceClasses
end procedure
procedure classLevelPropagation(S, T):
IF content of S different than content of T THEN
content of T <- content of S
end IF
// addition and removal of methods, attributes, etc.
listOfSourceBlocks <- CALL extractAssetTypeFromAsset with S and BlockType
listOfSourceMethods <- CALL extractAssetTypeFromAsset with S and MethodType
// compares and merges new or changed BlockType assets from source to target
// wrapped in feature annotations
CALL mergeFileBlockInTarget with T and listOfSourceBlocks
// compares and merges new or changed ClassType assets from source to target also
// propagates children of classes via classLevelPropagation wrapped in feature annotations
CALL mergeFileClassInTarget with T and listOfSourceClasses
end procedure
procedure methodLevelPropagation(S, T):
// includes changes in method signature and return type
IF content of S != content of T THEN
content of T <- content of S
end IF
// check if method blocks need propagation
CALL blockLevelPropagation with S and T
end procedure
procedure blockLevelPropagation(S, T):
latestTrace <- check trace from trace database for source and target
match on sourceAssetType
case None:
case foundTrace:
IF versionNumber of S > versionAt of foundTrace THEN
name of T = name of S
// merge source block into target blocks and add feature annotations
CALL mergeBlocks with children of S and children of T
versionNumber of T += 1
CALL ChangeAsset with T
end IF
end match
end procedure
Last active
June 6, 2021 23:19
-
-
Save totsteps/fdc74b7a994234d2d9a584955042a1bd to your computer and use it in GitHub Desktop.
VP Pseudocode for change propagation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment