Composite pattern with DSL for constructing trees of objects in to render them in JSON.