PureMVC Architects Lounge

PureMVC Manifold => Contributor Central => Topic started by: Rhysyngsun on March 18, 2008, 10:54:34



Title: Serialization Proxy - AIR
Post by: Rhysyngsun on March 18, 2008, 10:54:34
Just thought I'd share this little tidbit of code I wrote tonight. It's mostly a helper class, but handles opening the files and running the appropriate functions you pass to it.

It allows for either synchronous or asynchronous read/write of data to local files on AIR using a FileStream.

If you go synchronous you simply pass a function that takes a FileStream as its only parameter and serializes your data to it.

For asynch, you need to create an object that implements either/both of IFileReadResponder or IFileWriteResponder and pass it to the asynch methods. Put the read/write code in the onComplete method, should probably rename it for clarity.

I've also attached a mini AIR app that tests the synchronous code (haven't yet fully tested the asynch code, but fairly sure it works).

You'll also have to excuse the lack of comments (will do at later date), but much of the code is pretty self explanatory.


Title: Re: Serialization Proxy - AIR
Post by: puremvc on March 19, 2008, 08:31:18
Hey Nathan,

I haven't run the code, but I checked it out. This looks pretty useful. I think it needs to be worked into a demo and utility in the repository. Just make sure the asynch stuff works. And if you wouldn't mind throwing some ASdoc on the methods, I can generate it. You could too, but most people are baffled by the process at the moment is why I offer. :)

If anybody else sees some functionality that should go here, please comment on this thread.

Thanks,
-=Cliff>


Title: Re: Serialization Proxy - AIR
Post by: Rhysyngsun on March 19, 2008, 10:17:35
I've got the documentation working, just working through some bugs in the async code now.