Serializer
securely serializes a particular class of objects.
these objects keep their methods.
Usage
1. construct a serializer object
mySerializer = new Serializer<MyClass>(new MyClass());
note: for the time being, it is required to include a prototype object as constructor parameter
2. serialize Objects
myObjectString : string = mySerializer.serialize(myObject : MyClass)
3. deserialize Objects
myNewObject : MyClass = mySerializer.deserialize(myObjectString : string)
myNewObject
as you would myObject
;
4. use Assuming MyClass
has the method .myMethod()
, you can now call myNewObject.myMethod()
and expect the same results.
Limitations
You cannot transmit lambdas.