未验证 提交 08cec0e2 编写于 作者: W Wei Seng 提交者: GitHub

Update README.md

上级 1f6e6f34
......@@ -18,12 +18,15 @@ attributes by encapsulating them in single Data object.
Real world example
> Imagine you are cooking a stew for your family for dinner.You want to prevent your family members from comsuming the stew by tasting it while you are cooking, otherwise there will be no more stew for dinner later.
In plain words
> Private class data pattern prevent manipulation of data that is meant to be immutable by seperating the data from methods that use it into a class that maintains the data state.
Wikipedia says
> Private class data is a design pattern in computer programming used to encapsulate class attributes and their manipulation.
**Programmatic Example**
Taking our stew example from above. First we have a Stew class where its data is not protected by private class data, making the stew's ingredient mutable to class methods.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册