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 [2021-09-02 12:34] – old revision restored (2021-05-19 11:19) 65.21.179.175 | principles:model_principle [2021-09-02 12:34] – old revision restored (2021-05-19 11:19) 65.21.179.175 | ||
---|---|---|---|
Line 25: | Line 25: | ||
Real world actions are then // | Real world actions are then // | ||
- | Be precise with semantics. An operation '' | + | FIXME more detailed description |
- | Keep sure that your software models the reality by invoking the method that has the correct semantics and supplying it with the parameters that are needed from a requirements perspective. | ||
===== Rationale ===== | ===== Rationale ===== | ||
Line 33: | Line 32: | ||
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, | + | |
===== Strategies ===== | ===== Strategies ===== | ||
Line 39: | Line 38: | ||
* 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 a state machine) | + | * For artificial behavior that cannot be mapped to a natural class at least create a metaphor or an artificial model (like for example |
- | * 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 84: | Line 83: | ||
* **[[Tell, don't Ask/ | * **[[Tell, don't Ask/ | ||
* [[Low Coupling]] (LC): When designing a model for a software, it has to be borne in mind that structures with low coupling are desirable. | * [[Low Coupling]] (LC): When designing a model for a software, it has to be borne in mind that structures with low coupling are desirable. | ||
- | * [[Law of Leaky Abstractions]] (LLA): When building abstractions according to MP, keep in mind that there will most likely be abstraction leaks. A good abstraction minimizes those leaks. | + | |
==== Principle Collections ==== | ==== Principle Collections ==== |
principles/model_principle.txt · Last modified: 2021-10-18 21:47 by christian