4

Is there a way to display a bunch of JSON objects, WITH relations, as a domain model?

Models could be something like this:

{
  "name": "Order",
    "status": {
      "type": "number",
      "null": false,
      "default": 1
    }
  },
  "relations": {
    "customer": {
      "type": "belongsTo",
      "model": "Customer",
      "foreignKey": "customerId"
    }
  }
}

Basically, as this image shows, Domain model -to-> code... but the other way around.?

image

Thanks

PS: If there are no tools that do this out of the box, I assume that there might be frameworks that I could use to create this.. any recommendations?

glesage
  • 955
  • 2
  • 16
  • 31

1 Answers1

2

As I understand your question you are asking if a utility exists that can turn your JSON code into a domain model. If I understand correctly the answer is yes. There is one project on github that is doing something similar: json-discoverer

From the project page you will see the tool was inspired by some research which was published in ICWE (International Conference on Web Engineering) 2013 and 2014. Below is a link to the main article, as it is quite lengthy and detailed I will not attempt to summarize it here.

Unfortunately, as you mention you can't then edit the domain afterward. But I have still found it to be a fairly useful tool.

I am unaware of any other existing utilities. The only other alternatives are fairly easy to find with a simple search, but only allow for conversion to trees and/or tables.

FrankyHollywood
  • 1,497
  • 19
  • 18
Brett
  • 788
  • 7
  • 12