Subject |
avoid |
allow |
avoid by |
control |
has definition |
is part of |
have advantages |
improve |
is a synonym of |
duplication of code | because it increases the total volume of code and means that if you change the code in one place, then you might forget to change the code in the other places | | creating a separate method that has the common code, and calling it from the original location and any other needed locations | | | | | | cloning |
privacy | | changes to code to be more easily made since one can be confident that 'outsiders' are not relying on too many details | | | | | | encapsulation by ensuring that only programmers working inside a class (or inside a package) can use all of its facilities | |
restricting access | | | | access to methods, instance variables and class variables | | encapsulation | - makes code easier to understand and change
- makes designs more flexible
- reduces coupling
| | |
reuse | | | | | The practice of using the same code or design in more than one place | | | | |