-
HI! Thank you for this great repository! This repository helped a lot to understand a lot of patterns from P of EAA by Martin Fowler in practice. But I stumbled upon a problem. I was thinking about a case when I need validations that use SQL. In-memory validation would be too inefficient since I might need to load thousands of data in to the memory. Following DDD, we must have pure domain model, meaning we can't have dependency on other layers. So, I have 2 options in my mind:
Or is there a better way to do this? Also, Martin Fowler in his book talks about this issue. But he says we should use stored procedures or views in database. But does not talk about where we should call these methods. Edit: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hey. What do you mean by "validations that use SQL"? Also, I don't understand why do you want to use commands/events for validation, seems like you are overthinking it a little. You need to validate data that comes from a database, am I understanding it correctly? If so, I see two options:
Validation must be synchronous and you have to wait until it finishes before doing something else with that data. |
Beta Was this translation helpful? Give feedback.
Hey.
What do you mean by "validations that use SQL"? Also, I don't understand why do you want to use commands/events for validation, seems like you are overthinking it a little.
You need to validate data that comes from a database, am I understanding it correctly? If so, I see two options: