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.
@t3chb0t Thanks for your answer, I learned again something new from it! :) As Dmitry Nogin advised, I am going to refactor my code with introducing an abstract container class, so probably the exceptions will not be thrown anymore.
@DmitryNogin Yes, you are right about that I might not need DDD for this application, it is not that complex. It is a real application though, already deployed to production. But I needed a "learning project" in order to learn and apply DDD, and this project is ideal for me, since it is partly mine (used in family business)
@GertArnold There is of course a workaround for for the mentioned issue, f.e.: nodogmablog.bryanhogan.net/2014/11/… . But I do not want to place data layer relevant logic into my domain layer, it does not belong to it as far as i can judge the situation. Or maybe do you know a better solution for that? :)
@GertArnold Waoo, thank you very much for the detailed answers! I love it! As for your question about using strings instead of enums: I did not like to way that the enum values stored in dabatase as integers. When I read the tables, it was always a pain to figure what is the corresponding enum value of an integer and took time. Check this answer: codereview.stackexchange.com/questions/154676/… .