Home

JSON != XML

2008-05-16 @ 13:29#:-D

saw this today and was reminded of the time i spent pondering how to handle JSON<->XML issues in my exyus web engine. this quote sums is up nicely:

The short answer is that there isn’t a 1:1 mapping between XML and JSON.

This means that there isn’t a function

f : XML Document —> JSON Object

such that

((f)-1) . f = f . ((f)-1) = id

that's why i opted to go with a simple one-way JSON-to-XML pattern. it doesn't every *try* to go the other way. instead, web authors use hand-crafted XSLT to create JSON output from internal XML (of any kind). this makes for a bit more work, but cuts out a *huge* load of trundling and sweating over getting a consistent round-tripping of XML and JSON. not gonna happen.

code


lacey on rest - watch it

2008-05-14 @ 11:59#:-D

this is a solid interview w/ Pete Lacey (by Stefan Tilkov). check it out.

code


HTTP light bulb over my head

2008-05-07 @ 12:08#:-D

i've been digging quite a bit into the "hypermedia as the engine of application state (HATEOAS)" aspect of REST-ful implementations. to that end, i've been working to define valid media-types for XML and JSON that properly support "hypermedia" (links and forms in the document). along the way, it dawned on me that there is a fundamental aspect to HTTP conversations that i've not clearly seen before:

HTTP is all about state engines

the HTTP server is a state engine.
the Web browser is a state engine.
so...

when i decide to implement a desktop application that uses HTTP to communicate with a server, that desktop application should be a state engine, too.

this impacts the design/implementation of the client. and it impacts the design/implementation of the resources passed between client and server. if you define resources that are sent from the server to the client that contain well-understood hypermedia, the client can respond accordingly. it also means you can update the server resources and expose new hypermedia to the client without requiring a new version of the client.

hypermedia *is* the engine of application state!

code


the good parts is *good*

2008-05-05 @ 12:12#:-D

i already have this book on pre-order and i'm anxious to dig into it. based on Crockford's online writing, this book should be - if nothing else - entertaining[grin]. i now see that a sample chapter is available online - sweet!

code


lawn progress

2008-05-04 @ 14:58#:-D

progress on the front lawn is slow, but steady. most of the grass (what there is of it) is now growing pretty nicely. some of the new seedlings are still a bit thin, but they continue to grow. my biggest problem now is that the spurge weed is also pretty strong. this crowds out the grass and doesn't give the seedlings a decent change to establish.

i'm debating *when* i should do a weed treatment. would have to been in the next two weeks. that way i can do another round of spot seeding and give the new grass a chance to get established before the height of the dry season here.

my lawn