principles:model_principle
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
principles:model_principle [2018-12-08 10:24] – [Rationale] christian | principles:model_principle [2018-12-08 10:43] – [Description Status] christian | ||
---|---|---|---|
Line 33: | Line 33: | ||
When the structures in the software roughly correspond to the structures of the problem domain, a developer doesn' | When the structures in the software roughly correspond to the structures of the problem domain, a developer doesn' | ||
- | Moreover if something works accidentally, | + | Moreover if something works accidentally, |
+ | |||
+ | In the example above supplying a '' | ||
===== Strategies ===== | ===== Strategies ===== | ||
Line 39: | Line 41: | ||
* Create methods corresponding to real-world actions | * Create methods corresponding to real-world actions | ||
* Map additionally necessary behavior to natural classes instead of creating artificial classes | * Map additionally necessary behavior to natural classes instead of creating artificial classes | ||
- | * For artificial behavior that cannot be mapped to a natural class at least create a metaphor or an artificial model (like for example | + | * For artificial behavior that cannot be mapped to a natural class at least create a metaphor or an artificial model (like a state machine) |
+ | * Be precise with semantics. If you have an operation that currently does what you need but for slightly different reasons because it's an operation on the wrong abstraction level, create a new operation with the correct semantics. Have that new operation call the existing one as an implementation detail (e.g. have a '' | ||
===== Caveats ===== | ===== Caveats ===== | ||
Line 117: | Line 119: | ||
/* Choose one of the following and comment out the rest: */ | /* Choose one of the following and comment out the rest: */ | ||
/ | / | ||
- | [[wiki: | + | /*[[wiki: |
- | /*[[wiki: | + | [[wiki: |
principles/model_principle.txt · Last modified: 2021-10-18 21:47 by christian