Timeline for Can I put domain services inside domain entities?
Current License: CC BY-SA 4.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 22, 2020 at 21:25 | comment | added | Christophe | @kibe I think Eric Evans book is still very relevant and an excellent resource on the topic: well argumented and with meaningful examples. Since it’s really at domain level, technology and products don’t make it obsolete: whether you use a nosql database, an ORM, or an EF-core framework, it’s still the same model that needs to be designed. | |
| Jun 22, 2020 at 21:15 | comment | added | kibe | @Andy thanks for all the answers, seriously. I'm just learning DDD and it fascinates me how it makes you leave the database for last and focus on how your app behaves independently of external sources. do you guys have a good resource where I can learn more about DDD? is the Eric Evan's book still relevant? thanks | |
| Jun 22, 2020 at 20:19 | vote | accept | kibe | ||
| Jun 22, 2020 at 9:52 | comment | added | Christophe | @Andy Indeed, this is an uncomfortable question, because in some cases the 20 is a rule decided by business (exactly as in old forms where there was a box for every letter). But in some case it’s an arbitrary implementation decision made for example for the DB schema that propagates to UI and other levels (and in some case it doesn’t even account for character encoding). The interesting point in RikD’s comment, is that anyway, there can be different types of validations (i.e. each with different answers to the proposed set of questions) which all could fit at different places in domain model | |
| Jun 22, 2020 at 9:37 | comment | added | Andy | @RikD what do you mean a length of a certain field is not a business rule? Surely the business may dictate that a username may not be longer than 20 characters. If it does, where would such rule fit in your case? | |
| Jun 22, 2020 at 9:12 | comment | added | Christophe | @RikD Indeed! Excellent point: there may be several kinds of validations. To my defense, I said both are possible but I never said that they were mutually exclusive. In addition the accepted answer to the first example of validator questions addresses this very well and I assume OP will read it. Thanks for the suggestion, I’ve added a question to make sure that it’s not forgotten. | |
| Jun 22, 2020 at 9:10 | history | edited | Christophe | CC BY-SA 4.0 | added 188 characters in body |
| Jun 22, 2020 at 9:00 | comment | added | Rik D | It's a good answer, but you make it sounds like there should be a a single place to validate. In reality, different concerns are validated in different places. The domain should be responsible for validating business rules. If you want to store a name in a database field with 20 chars, validating that the length doesn't exceed 20 is not a business rule. | |
| Jun 22, 2020 at 7:40 | history | edited | Christophe | CC BY-SA 4.0 | added 1217 characters in body |
| Jun 22, 2020 at 7:21 | history | answered | Christophe | CC BY-SA 4.0 |