Model-Driven Node: Object Graph Impedance

Node.js purists may question this synthesis of java tooling and node.js but I'm generating js with java for several reasons:

  • Reflection - It's better in java.
  • Templating - Velocity is fast, easy, and I haven't found a js equal yet.
  • Annotations - the jax-rs annotations which are well-defined and comprehensive.
  • Xsd - more mature and better tool set than json.

I'll investigate alternatives some day, but the tooling has no bearing on the final product. My Velocity java projects had substantially fewer bugs and I suspect this effect will be greater for javascript-based projects.

I tested the node generator with a 600-element (table) hl7 model. It flushed out a bug, but it also demonstrated a significant impedance mismatch between the model's object graph and probable REST API. I kind of knew that already but this schema made it clear, as it's nested up to sixteen elements deep. It's unlikely you'd want to mimic that in the API, so breaking apart the graph becomes an art. I could automate it but I'm not sure I should.

Part 1: Model Driven Node
Part 2: Multi-Tenant
Part 3: Object Graph Impedance
Part 4: Extending XSD Schema
Part 5: XJC Compiler
Part 6: Scalability
Part 7: Reference Implementation
Part 8: Tags and Queues
Part 9: URL Namespacing
Part 10: JSON Editor and Angular

Source Code