Law of demeter Flashcards
(13 cards)
What is Software rigidity?
The tendency for software to be hard to change even in simple ways.
Symptom and effect of rigidity
Symptom: Every change becomes a cascade of subsequent changes in dependent modules
Effect: Managers fear developers to fix non critical issues
What is Software fragility?
The tendency for software to break in many places every time it is changed. Breakage occurs in areas that have no conceptual relationship with the area that was changed
Symptoms and effects of Fragility
Symptom: Every fix makes it worse, introducing more problems than are solved.
Effect: Every time managers auth a fix, they are scared to what in the system will break
What is Software immobility?
the inability to reuse software from other projects or part of the same project
Software immobility symptoms and effects:
Dev discovers he needs to use a module that is similar to what another wrote but their is too much baggage to use it
effect: Software is rewritten
What is Software viscosity?
The tendency of software development environment to encourage software changes that are hacks rather than software that keeps the original design intent.
Best way to understand it is working software vs good software
Software viscosity symptoms and effects:
Symptom: Easy to do the wrong thing, hard to do the right thing.
Effect: Software maintainability suffers
Why do such problems occur
- Domain complexity
- Time/resource constraints
- Changing tech
What is the Law of Demeter?
The law to only talk to your immediate friends/classes.
IE keep access within an objects scope, don’t force outside access
Law of Demeter for methods
Requires that a method m of an object O may only invoke the methods of the following objects:
O itself
M parameters
Objects made in M
Object made components
Global variables in O
Law of Demeter features:
- Minimize the no of acquaintances which directly communicate with a supplier
- Access the supplier method only through methods of preferred acquaintances
Acceptable law of Demeter violations
- Optimization
- If module accessed is a fully stable black box