dcsimg
Results 1 to 3 of 3

Thread: [VB6] JNode - JSON revisited

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    20,922

    [VB6] JNode - JSON revisited

    JNode is a "little brother" or alternative to my JsonBag.

    This take on the subject is a kind of stripped down minimal implementation of a VB6 JSON handling Class. Don't read anything into the name (the "node" part is just a node, as in a node in a tree of objects).

    JNode 1.0 weighs in at less than half the size of JsonBag 2.4 in source code terms. The main difference is that JNode makes no attempt to use any API calls or pointer operations to try to gain performance: everything is straight-up VB6 code. While this may reduce performance a bit most client-side real world JSON applications just aren't performance-critical anyway. In testing it seems plenty fast enough for most uses.


    Requirements

    Written as VB6 code, so you'd need VB6. But it is pretty "clean" VB6 so it may import right in and work in any VBA6 or later host, even 64-bit ones. Might work without changes in VB5 too, though I haven't looked at that.

    A version of Windows that can run VB6 programs and has or can support Microsoft's Scripting Runtime - since JNode uses Dictionary objects.


    Remarks

    I had originally left out serializing adding white space. I decided to add that in though because a big hunk of JSON without it can be frustrating to read through when you are debugging.

    This is not a drop-in replacement for JsonBag, but it should be reasonably close and usable as a replacement in many applications without a lot of trouble.

    I haven't created any fancy documentation for JNode, which I have found almost nobody has been reading anyway. Perhaps the code in the test cases included in the demo Project is enough. I might address this later though.

    I miss a few things, for example the CloneItem property in JsonBag. But not enough to bloat JNode by adding such a thing into it. Most of the things I use it for can by done simply by creating a new JNode and assigning its JSON property to the JSON property of the JNode I want to clone. Slow perhaps, but not that slow and good enough for most purposes anyway.
    Last edited by dilettante; Oct 15th, 2015 at 05:47 PM. Reason: removed bad version's attachment

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width