UML: TIP: Java: use private fields/attributes rather than "hidden" anonymous features and local variables in method implementations to reveal usages as Properties.

Exceptions include local variables for trivial Java utilities like StringBuffer, although even then using private fields hurts little. The motivation here is to put the graphical "efficiency" of Unified Modeling Language™ (UML™)-driven engineering before code-level efficiency.

This will enable you to reverse-engineer dependencies and the role of classes used in your designs into associations in the UML. It can save you a lot of time and help your model-driven development, at a slight performance cost to your computer. And yes, it does seem to contradict a popular Java efficiency practice; do it anyway !

Used in
randomness