Design Principles Flashcards
bad software design exhibits at least one of which 3 traits?
Rigidity, Fragility or Immobility (While still satisfying main requirements)
Define: Rigidity
Rigid if software is hard to change, because every change effects many other parts of the system
Define: fragility
System is fragile if, when changes are made, unexpected parts of the system break
Define: Immobility
Immobile if system is hard to use in another app, because it is difficult to disentangle from current app
Define: System
A set of cohesive modules working together to satisfy a set of requirements
Define: Pre-Condition
Checking the validity of an input before it is used
Define: Post-Condition
Condition that must evaluate to true after the execution of some code
Define: Coupling
How reliant a module is on its neighbors
Define: Cohesion
The strength of a relationship between a module and its neighbors
Define: System Boundary
The definition of what aspects are part of the system, and which aspects are not.
Define: Single Responsibility Principle
every module or class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class
Rule for connections between modules
If a system has n modules, the # of connections should be closer to (n-1) than to (n(n-1)/2)
Layers vs. Partitions
Layers: Reliant on other layers to function Increases coupling
Partitions: Not reliant on other partitions to function. Decreases coupling
Perks of high cohesion?
Complexity is manageable
Good code readability and reusability
Features of Modularity
De/Recomposability
Understandability
Continuity
Protection