How to use Interfaces in Domain Modelling DDD

17 views Asked by At
  1. Can we use interfaces in DDD Domain Modelling(if Possible is it advisable)?

The reason why I was asking is that I was trying to find the best way to model the data below.

The backstory is that in my App I need to communicate with Different renderers one renderer I am sending data over TCP and in the other I am writing data to a File.

Is it good practice to have different types of Objects In a collection in Json? Or would be better to Split the Data of One Json with the ID and Type I would then make another trip to the database/API using the Id from the first json so that I can get all the 'rendererDatas'.

If the below Json is up to standard what's the best way to model this in DDD?

[
    {
        "id": "859b6427-a84a-4ac7-1234-21864cf46c86",
        "name": "string",
        "description": "string",
        "rendererDatas": [
            {
                "id": "ea0e7e36-ffe0-6543-83f0-23d46968b2aa",
              "name": "string",
                "DataType": "Viz",
                "description": "string",
                "IPAddress": "123.123.123",
                "rendererAttributes": [{"FirstName":  "John", "Number": "8"}]
            },
            {
                "id": "ea0e7e36-6543-6543-83f0-23d46968b2aa",
                "name": "string",
                "DataType": "Ventuz",
                "description": "string",
                "FilePath": "C:\Data",
                "Payload": "Json payload with Firstname and Number"
            }
        ]
    }
]
0

There are 0 answers