I am now struggling with a dilemma. In my system I get a lot of data from various sensors in one complicated message and not well structured message. I can't influence it's structure and it also changes quite often, so as a first step i translate it to my own object, let's call it MyMessage.
Then there is a rule that if a sensor of the data exist in my DB (valid data), I should process the data and if not (invalid data), then I should store the data to a table and try to reprocess them later.
My question is following: Who should do the validation if the sensor exist in the database. Should MyMessage decide what data are valid and provide them separately from the invalid data.
I try to combine the Domain Driven Design and also keep the Single Responsibility Principle. That means if the MyMessage would be able to validate itself, then I will break the SRP. But if there is some Validator or Splitter, that splits the valid and invalid data, then I break the fundamentals of DDD, because I add some new component, that has nothing to do with the domain.