converting workspaces and using salt subversion to maintain them n.
Skip this Video
Loading SlideShow in 5 Seconds..
Converting workspaces and using SALT & subversion to maintain them. PowerPoint Presentation
Download Presentation
Converting workspaces and using SALT & subversion to maintain them.

Converting workspaces and using SALT & subversion to maintain them.

68 Views Download Presentation
Download Presentation

Converting workspaces and using SALT & subversion to maintain them.

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

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

  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. BAAD's SD2 product • This unit is self contained: its behaviour is set once and does not require external input. • There are several (possibly 1000s) models, each with a different code name. The logic (code) of each is unique.

  10. BAAD's SD2 product • Unit is made of 2 main components: • a driving component • a weapons component

  11. Testing the product • Obviously, testing these devices in real life presents a problem • In its infinite wisdom the company has decided to use a simulator written in (what else?) Dyalog APL • A single workspace holds all the system

  12. The simulator Battlefield Units' Consoles Battling units

  13. The simulator

  14. 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)

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

  16. 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

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

  18. 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

  19. 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.

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

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

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

  23. 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

  24. 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

  25. 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

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

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

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

  29. Converting the workspace )LOAD our workspace:

  30. Converting the workspace Bring in the conversion tools:

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

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

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

  34. Converting the workspace Then use an expression like:

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

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

  37. 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 is a bit more complex. Again, SALT comes in handy.

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

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

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

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

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

  43. 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.

  44. Making changes Here's what one of the units' logic looks like:

  45. Making changes And here we make a change:

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

  47. 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)

  48. 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.

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

  50. Version Control We picked folder \weapons as repository