Domain development: how to get lists of complex data

I am creating a new application using my current understanding of domain-driven design. So far I have a bunch of classes representing objects in my domain, and a repository for retrieving / saving to the database.

The problem I am facing is that in the user interface I need to display several lists in which the items in the list are not directly mapped to any objects in my domain. Some of these lists can be built by loading fairly deeply on certain objects, but other data is essentially synthesized during the search and is not part of any object. Let me give you an example that I hope will explain the problem more clearly.

In my domain, I have ratings (a set of questions to answer) and answers (the answers that each user provided to the rating) for these ratings. I also have actions. Each action is an action that has been accepted with a response (send, approve, reject, etc.). I also have users.

One of the lists of data that I need to display will include answers and ratings (which were not answered), then each line will include information about the user who is currently working with the answer (this is determined when searching for time, looking at the actions that were undertaken in response). Each position will also include zero or more children, which are actions that have been taken in response so far.

The problem is that right now I can’t imagine all this dataset with my domain entities. My first reaction would be to simply get the data from the database and go around the objects of my domain. But I see great value when working with domain objects and has a relationship between different objects baked in the objects themselves. Therefore, my next idea would be to modify my domain entities to support these lists, but I am concerned that I am adding strange properties to my objects only to support these listing scenarios and that I could be detrimental to performance by essentially doing deep loads of objects. when I need only this data in several places in my applications.

+5
source share
2

-, , ( , ), , . .

, .

, , - . , .

+2

, ( ) ​​ . , , -, ​​ , " ". , , , , ...

+2

All Articles