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 [2013-02-18 17:45] – [Caveats] christian | principles:model_principle [2021-09-02 20:01] – old revision restored (2021-05-11 22:08) 65.21.179.175 | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Variants and Alternative Names ===== | ===== Variants and Alternative Names ===== | ||
- | * Direct Mapping((Bertrand Meyer: // | + | * Direct Mapping(({{page> |
- | * Low Representational Gap (LRG)((Craig Larman: //Applying UML and Patterns | + | * Low Representational Gap (LRG)((Craig Larman: //[[resources: |
===== Context ===== | ===== Context ===== | ||
/* fill in contexts here: */ | /* fill in contexts here: */ | ||
- | * [[contexts: | + | * [[contexts: |
+ | * [[contexts: | ||
+ | * [[contexts: | ||
+ | * [[contexts: | ||
Line 39: | Line 43: | ||
===== Caveats ===== | ===== Caveats ===== | ||
- | This principle may lead to the problem of modeling the real world in too great detail. This complicates the design without giving any further benefits. | + | This principle may lead to the problem of modeling the real world in too great detail. This complicates the design without giving any further benefits. Especially a wrong understanding of inheritance may lead to [[anti-patterns: |
See also section [[#contrary principles]]. | See also section [[#contrary principles]]. | ||
Line 49: | Line 53: | ||
> " | > " | ||
- | Although this view is disputed as a definition for object-oriented programming, | + | Although this view is disputed as a definition for object-oriented programming, |
===== Evidence ===== | ===== Evidence ===== | ||
/* Comment out what is not applicable and explain the rest: */ | /* Comment out what is not applicable and explain the rest: */ | ||
/* * [[wiki: | /* * [[wiki: | ||
- | /* * [[wiki: | + | /* * [[wiki: |
- | * [[wiki: | + | * [[wiki: |
- | * [[wiki: | + | * [[wiki: |
Line 75: | Line 78: | ||
* [[Single Responsibility Principle]] (SRP): Following the Model Principle sometimes results in classes having more than just one responsibility. | * [[Single Responsibility Principle]] (SRP): Following the Model Principle sometimes results in classes having more than just one responsibility. | ||
* [[High Cohesion]] (HC): MP sometimes creates classes with suboptimal cohesion. See also SRP. | * [[High Cohesion]] (HC): MP sometimes creates classes with suboptimal cohesion. See also SRP. | ||
+ | |||
==== Complementary Principles ==== | ==== Complementary Principles ==== | ||
* **[[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. | ||
- | |||
Line 87: | Line 90: | ||
{{page> | {{page> | ||
- | ===== Example | + | ===== Examples |
==== Example 1: Object Structure (Library) ==== | ==== Example 1: Object Structure (Library) ==== |
principles/model_principle.txt · Last modified: 2021-10-18 21:47 by christian