User Tools

Site Tools


principles:model_principle

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
principles:model_principle [2018-12-08 10:24] – [Rationale] christianprinciples:model_principle [2018-12-08 10:35] – [Strategies] christian
Line 39: Line 39:
   * 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 a state machine) +  * 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 ''cancelOrder'' method call the ''deleteOrder'' method).
  
 ===== Caveats ===== ===== Caveats =====
principles/model_principle.txt · Last modified: 2021-10-18 21:47 by christian