Decoupling the Remix Process from How a Remix is Saved
We have decided that we will use the current XML actionscript format for saving remixes. However, the current implementation requires the actionscript to be written to a file before it can be remixed into a world. The simplest solution is to just write the actionscript to a socket instead of a file so that it can be sent straight to a database on the server. The drawback is that changing the location to which the actionscript is written only solves the proximate problem of getting the actionscript to the server without first writing it to a file. The ultimate problem is that the current implementation tightly couples the remix process with the process of writing the actionscript to some location not in memory.
If we can break the tight coupling of remixing and saving an actionscript, we will have more flexibility in the future to change how we store remixes (possibly something completely different from the actionscript XML format) without worrying about breaking the middle of the remix process. Currently the data structures of the precompiled script are written to a file, read back in, and used to created the compiled script. In order to decouple remixing and saving an actionscript, I will do the following:
1) I will make the process more symmetric by first creating a precompiled script when the data structures are read back in. That way a precompiled script is written to a file and a precompiled script is read back from a file.
2) I will create a "compiler" that will convert a precompiled script to a compiled script.
Together these changes will enable us to skip the step of writing to a file. Then we can move on to uploading the actionscript to the server.