java-design-patterns/private-class-data
Ilkka Seppälä 417f21ed3d
Code cleanup (#1461)
* Code cleanup

* Fix flux tests

* Fix checkstyle errors

* Fix compile error
2020-07-30 20:28:47 +03:00
..
2019-12-07 18:03:49 +02:00
2020-07-30 20:28:47 +03:00
2019-12-18 22:04:08 +02:00

layout, title, folder, permalink, categories, tags
layout title folder permalink categories tags
pattern Private Class Data private-class-data /patterns/private-class-data/ Idiom
Data access

Intent

Private Class Data design pattern seeks to reduce exposure of attributes by limiting their visibility. It reduces the number of class attributes by encapsulating them in single Data object.

Class diagram

alt text

Applicability

Use the Private Class Data pattern when

  • You want to prevent write access to class data members