Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
When you tell the root can show child entities, do you mean it is correct if a consumer ask to the root entity for a child, the root entity can return the child that the consumer ask for? I mean, a consumer ask order for line 2, is correct the order return the line 2 to the consumer? The consumer will not can modify the line, because the line has not public methods to modify the line. The consumer will only can access data with readonly properties and get methods. If this is not correct, how could a consumer to know for example the price of a line?
Yes, you are right, and thinking more about it, I think that from a point of view, is the domain who has to decide if an action needs to ensure the coherence or not. Later the persistance has to ensore that thechnically it is done correctly. Perhaps I could think that instead of the domain, I could increment the version in the application layer, but thinking in the application layer as layer the coordinate domain and persistance, perhaps to decide if increment or not it is to know about domain matters. So according to that, it seems domain is not a bad place to care about concurrency.
Thanks. I understand the point, that sometimes it is needed to accept that to don't make so difficult some things. Also I have read sometimes that the domain shouldn't know anything about implementation or technical aspects, and concurrency is something that I think it can be considerate in this way, so it is another reason why at first I try to avoid to make the domain to be conscious about the concurrency.
@FrankHileman Yes, I was thinking more how I could allow only my application can use the server. But if the client uses he public certificate to authenticate it, if someone get this certificate is possible to another application use the server. As Ben tells, once a certificate is in a device, it is out of my control. But this make me think about OpenVpn, for example. It uses certificate and key to authenticate and encrypt the data, and this certificate and key are in the user device, that can be stole. But in another side, OpenVpn is considerate secure. This is my main doubt.
Thanks for the comments. Yes, perhaps it is a very small application that I can develop faster and in simplier way without DDD, but sometimes the examples that can be found are big or complex and for a first time can be a bit complicated, so it is why I would like to try to think a very small example and try to think in a DDD away. I appreciate your comments so much, and the suggestions.
@RobertHarvey Well, I am starting to learn about DDD and I was thinking in this basic example. I was considerating the Game a my context, the player, the match and the rounds as entities and also the behaviour about them. For simplify, the Arbitrator asigns the turn to a player, then the player can request card, throw, bet... al this is notify and attended by the arbitrator. When arbitrator decides its turn is finished, it gives the turn to the next player... and so. Accoding with the example of the cab in the link, I think I have the basic concepts. But I could be wrong, sure.
@ErikEidt A player can play many rounds in different matches, yes, but I I only want to know the time of a player in a round. From a database point of view it would be something like this: Round(IdRound, IdMatch, IdPlayer, time).
Also i have another question. Isn't would be better in the share service method to check if the user can share and the so call the mehtod Document.Share() without passing the user by parameter? because in some way the document shoud only do the action to share, no check, and in this way the document wouldn't know about user entity and the concepts would be more isolated.
It is a good option, but my doubt is, the service, is a service in the domain layer or in the application layer? From my point of view I think it belongs to the application layer, because it request data from repositories and I prefer the domain doesn't know about persistance in any way.
Thanks for the comment. Well, in my case I want to use gRPC to can request some data from a server, but I don't need to identify each client in a unique way, just i want to encrypt and secure the data. But I would like to develop a client that I can redistributate in a zip and any user could use it just unzipping the application in his computer. So in this case I was thinking that the certificate belongs more to the client application that to the user.