Timeline for Altering the state of a composed class by its composing classes. Is there any rule or principle for not doing so?
Current License: CC BY-SA 4.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 20, 2020 at 12:51 | comment | added | Ewan | I think it can, exposing the composition is problematic in many cases, and i would avoid it., child objects that call their parent have similar issues but are sometimes used well for recursive patterns | |
| Aug 20, 2020 at 12:47 | vote | accept | Darius | ||
| Aug 20, 2020 at 12:47 | comment | added | Darius | I accept this answer, because it answers directly and with demonstration, on what the question asks for, which is a principle or rule that stand against the refactoring approach I brought as suggestion. However, the question has a broader sense and I wonder if this could be seen as a general rule to be applied for every composition pattern. | |
| Aug 14, 2020 at 23:55 | history | answered | Ewan | CC BY-SA 4.0 |