Search code examples
javascriptjsonterminologycode-complexity

In JavaScript, is there a word to describe a JSON-serializable object?


I'm looking for a term for simple objects that emphasizes their simplicity. Specifically, objects that are free of self-reference, and contain no methods, bindings, etc (i.e. JSON-serializable).

Right now I use words like:

  1. "flat object"
  2. "simple object"
  3. "data container object"
  4. "JSON-serializable object"

I don't like them because:

  1. Implies lack of hierarchy, which is actually fine.
  2. Seems vague.
  3. Also seems vague.
  4. Not a direct reference to complexity, more an emphasis on requirements. It isn't often that JSON-serializability is actually a requirement, while simplicity is.

Examples of objects I'm looking to describe:

var good_1 = {};

var good_2 = {a: 1, b: 'str'}

var good_3 = {thing: [1,
                      {a: 1,
                       b: 'str'},
                      'word'],
              otherThing: 42};

Examples of objects I want to differentiate from:

var bad_1 = {thing: 3,
             getThing: function () { return this.thing; }};

var bad_2 = {a: 1};
bad_2['self'] = bad_2;

Question

What should I call objects that are free of self-reference, and contain no methods, bindings, etc (i.e. JSON-serializable)?


Solution

  • Plain Old Data Structure.

    PODS, for short. They're a data structure comprised of only data fields, no behaviour. The term is language-agnostic.

    Context: they're often mentioned in the same breath as POJOs (Plain Old Java Objects), which vary a bit in definition. This wikipedia page says they're essentially PODS with getters and setters. Some googling will turn up disagreement, though.