mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-23 12:25:18 +00:00
Update README.md
This commit is contained in:
@@ -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