Timeline for Trying Out DDD : How to enforce data integrity and immutability
Current License: CC BY-SA 4.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 4 at 22:03 | history | became hot network question | |||
| Feb 4 at 21:12 | answer | added | STerliakov | timeline score: 5 | |
| Feb 4 at 18:11 | comment | added | koussay issaoui | @STerliakov, first of all, thank you for your response !! I deeply appreciate it, now coming to your question, Yes you are correct, the getter can be implemented in the base class, but I wanted to expose it to the child class just in case I wanted to modify something or attach a prefix ... indeed I want the child class to be minimalistic, but I thought it is good to force the developer to implement it in the child class for consistency, to know that he must use the getter and not try changing the modifiers by making message a public. but what do you mean by internal inconsistency? | |
| Feb 4 at 16:16 | comment | added | STerliakov | What implementations do you want to support for e.g. @property message? If that's just a getter for _message, at least don't make it abstract. If it can be smth other, you created some internal inconsistency: a child class will still have some _message atttribute unrelated to public message. (please reply - my answer will significantly depend on that) | |
| Feb 4 at 14:05 | comment | added | koussay issaoui | @Reinderien yessss exactly, i really appreciate your patience with my chain of thought | |
| Feb 4 at 14:03 | comment | added | Reinderien | So all other children have different, fixed codes but parametric message and stack trace? | |
| Feb 4 at 13:56 | comment | added | koussay issaoui | @Reinderien i need to explicitly define init to make the args named + when I call ``` instance = self.factory_child_constructor(message= message, stacktrace=stacktrace, code=34)``` I'm manually setting the code for this type of failure object to be 34, I will be doing that for all of the other child classes. If you think this could be done otherwise, can you please elaborate? | |
| Feb 4 at 13:49 | comment | added | Reinderien | Why does ValidationFailure need a constructor at all if it doesn't have any additional properties? | |
| Feb 4 at 13:41 | comment | added | koussay issaoui | @Reinderien because i needed a way to pass the arguments to the super constructor while calling the validation logic from the parent class, that is the purpose of factory_child_constructor function, however the resulting base instance should be assigned to the current child instance. meaning I can not return the new instance in the child init , the only way would be by forcing forcing the child dict to be set only inside the constructor, in fact that is the part that I want help with, that is the only method that I could come up with. | |
| Feb 4 at 12:12 | history | edited | koussay issaoui | CC BY-SA 4.0 | deleted 93 characters in body; edited title |
| Feb 4 at 12:04 | history | edited | toolic | CC BY-SA 4.0 | deleted 14 characters in body; edited tags |
| S Feb 4 at 12:01 | review | First questions | |||
| Feb 4 at 12:04 | |||||
| S Feb 4 at 12:01 | history | asked | koussay issaoui | CC BY-SA 4.0 |