mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-03 11:12:23 +00:00
Update README.md
This commit is contained in:
1 parent
2a5b8c977a
commit
b9b6777d15
5 files changed
+29
-24
No files matched your search
@@ -9,6 +9,7 @@ tags:
|
||||
---
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -124,9 +125,11 @@ immutableStew.mix(); // Mixing the immutable stew we find: 2 potatoes, 4 carrot
|
||||
```
|
||||
|
||||
## Class diagram
|
||||
|
||||

|
||||
|
||||
## Applicability
|
||||
|
||||
Use the Private Class Data pattern when
|
||||
|
||||
* You want to prevent write access to class data members
|
||||
* You want to prevent write access to class data members.
|
||||
Reference in new issue
Block a user