On Mon, Mar 2, 2009 at 2:34 AM, Amy <[email protected]> wrote:

> Plain text. Long before the invention of XML, developers used csv
> or csv-like files to power their data-driven apps. You'll have to
> load the plain text into objects, but hopefully you don't have a
> constraint against that :o)

Thanks for the suggestion. Sure, I can do some kind of a plain-text format
-- Fixed-length (not likely)
-- Variable length with length bytes
-- Some kind of delimited system (csv or what have you)

Depending on the content,
-- Fixed length is a bad idea...but it's useful in other contexts.
(For example, if you have a 'natural index' that lets you calculate a
rows position - then you can grab a row out of a huge file with a
couple of reads... but that's not my problem.)

-- Variable-length with a length byte: This would add only one byte
per variable-length item, so it's about as efficient as I can get.

-- Delimited system: Not as efficient as the previous method, but
popular so easy to support in many ways.

What I'm compariing against are two things:
1) The naive 'stupid unreadable XML' format that lets me keep using
XML but reduces the message size a bit.
2) True compression/binary format.

The unreadable XML approach reduces message size by making element
names shorter and removing whitespace. For example, instead of

<ResultSet>
     <Record>
        <FirstName>Bob</FirstName>
    </Record>
</ResultSet>

...you get something like this:

<a><b><c>Bob</c></b></a>

This obviously throws away the advantages of XML as 'human readable
markup'...an advantage that is irrelevant in my case - I'm just trying
to send messages that are produced by one program and read by another
program - no humans involved.

What I'm really hoping for is real compression - as plain text or XML
tend to compress fairly dramatically. Either that, or some other
binary format this is not AMF and that is supported natively in Flash.

Sorry for the length of my answer...I just suck at writing short
messages when I'm sorting through a problem. And, again, thanks for
the help.

Reply via email to