1 / 60

Converting workspaces and using SALT & subversion to maintain them.

Converting workspaces and using SALT & subversion to maintain them. V1.02. Introduction. This is an example of converting an existing application to SALT and using a version control system afterwards to maintain it. What is SALT?.

doriswilson
Download Presentation

Converting workspaces and using SALT & subversion to maintain them.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Converting workspaces and using SALT & subversion to maintain them. V1.02

  2. Introduction This is an example of converting an existing application to SALT and using a version control system afterwards to maintain it.

  3. What is SALT? SALT is a tool to deal with code outside the workspace in text (Unicode) format.

  4. Script form Up until V11 namespaces came in a single form. They contained functions, variables and other namespaces.

  5. Script form Starting with V11 namespaces also came in a script form. The contained functions, etc. are listed in text format:

  6. Script form The script and the functions in it can be edited via the editor, e.g. )ED ns2 )ED ns2.tfn1

  7. How do we do it? • We'll see the conversion process and • how to use subversion, a third party product, to control its versioning

  8. The situation • BAAD is a military weapons manufacturing company • One of its best sellers is the SD2, a device used to search and destroy specific targets

  9. The simulator's structure • The workspace is divided into namespaces • One namespace contains all the units' logic, here its name is 'R' (for Robots) • Each unit's logic is also contained in a namespace whose name is the name of the unit (like CARLA or AI2)

  10. The simulator's structure Here, namespace R is where all the Units' logic reside

  11. Updating the workspace • This involves modifying individual units' code in their respective namespaces • and resaving the entire workspace when finished with the changes • This prevents other users from updating the workspace at the same time

  12. Acceptable updating timeline Tester A change save load Time save load change Tester B Sequential updates

  13. Unacceptable updating timeline Tester A change save load Time save load change Tester B Tester A's changes are overwritten by Tester Beven if the modified namespace is different

  14. Tracking changes Another problem with this model is that changes are irreversible. Even tracking changes is difficult. Finding differences in code is hard to document.

  15. Dyalog V11.0 This version allows namespaces to exist in script format. Instead of having a series of namespaces each with functions and variables

  16. Dyalog V11.0 You can have everything in script form, including the definition of variables

  17. workspace Scripts files Keeping namespaces in scripted form allows us to save them in (Unicode) text files outside the workspace.

  18. Updating can now be done in parallel for different namespaces change Tester A namespace A save load Time save load namespace B Tester B change Tester A's changes are NOT overwritten by Tester B

  19. Tracking changes It is easier to track changes now that files are in human readable format. By saving multiple copies we can see the difference between each modification. workspace

  20. Tracking changes Comparing files can be done easily in APL by SALT or by any 3rd party program. Line a Line b Line c Line a Line X Line c

  21. Doing it The first step is to convert the workspace to the new form

  22. Converting the workspace Start Dyalog, SALT should be there:

  23. Converting the workspace If it isn’t we have to make sure SALT is enabled:

  24. Converting the workspace )LOAD our workspace:

  25. Converting the workspace Bring in the conversion tools:

  26. Converting the workspace NStoScript is a namespace containing code to perform conversion of regular (non sourced) namespaces. The function to use in it is <Convert>.

  27. Converting the workspace For example, to convert namespace 'UTIL':

  28. Converting the workspace To convert several namespaces first )CS where the namespaces are:

  29. Converting the workspace Then use an expression like:

  30. Converting the workspace Explorer now shows us the namespaces with the new icons:

  31. Converting the workspace The workspace has the same functionality as before. It can be )SAVEd in this new format

  32. Filing away The next step is to store those namespaces in Unicode files. Altho is it relatively simple to read/write text to file, their management, because of the encoding, is a bit more complex. Again, SALT comes in handy.

  33. Saving the scripts as text files • decide where to put them • use the SALT Save function

  34. Saving the scripts as text files The Save function takes a string argument of: 'namespacelocation':

  35. Saving the scripts as text files To save all the namespaces at once do:

  36. Saving the scripts as text files If you want to save everything at once you can do instead

  37. Saving the scripts as text files Either way you should now have a folder with many scripts in it:

  38. Making changes SALT 'remembers' where each script was saved. Changing one of them now means SALT will change the file as soon as the script is modified through the editor.

  39. Making changes Here's what one of the scripts' contents looks like:

  40. Making changes And here we make a change:

  41. Making changes SALT detected the change and offers to change the script file:

  42. Making changes You should )SAVE the workspace here. Like this SALT will remember where the edited namespaces are stored and detect if changes have been made outside APL (e.g. with Notepad)

  43. Version Control This is the 2nd part of the work to do. SALT comes with its own versioning of files and comparison functions but it is primitive compared to state of the art version control systems like subversion.

  44. Version Control For a company it is preferable to use existing software like subversion. To use subversion we first need somewhere to put the scripts files.

  45. Version Control We picked folder \weapons as repository

  46. We now import the scripts into the repository: (we put our code in 'Troops') Version Control

  47. One of the testers now checks out a copy: Version Control

  48. Version Control Any other tester can do the same thing and update it independently. tester n repository tester x checkout checkout checkout checkout tester 7 tester 3

  49. He can see what's in his folder Version Control

  50. And use any portion (pattern) of it Version Control

More Related