- Design Patterns and Best Practices in Java
- Kamalmeet Singh Adrian Ianculescu LUCIAN PAUL TORJE
- 98字
- 2021-06-25 20:52:39
The memento pattern
Encapsulation is one of the fundamental principles of object-oriented design. We also know that each class should have a single responsibility. As we add functionality to our object, we might realize that we need to save its internal state to be able to restore it at a later stage. If we implement such functionality directly in the class, the class might become too complex and we might end up breaking the single responsibility principle. At the same time, encapsulation prevents us having direct access to the internal state of the object we need to memorize.
推薦閱讀
- UML和模式應(yīng)用(原書第3版)
- WebAssembly實(shí)戰(zhàn)
- 編寫高質(zhì)量代碼:改善Python程序的91個(gè)建議
- Django:Web Development with Python
- Learning Linux Binary Analysis
- Django Design Patterns and Best Practices
- Python爬蟲(chóng)開(kāi)發(fā)與項(xiàng)目實(shí)戰(zhàn)
- Raspberry Pi 2 Server Essentials
- Getting Started with SQL Server 2012 Cube Development
- 軟件項(xiàng)目管理實(shí)用教程
- Learning Nessus for Penetration Testing
- 網(wǎng)絡(luò)數(shù)據(jù)采集技術(shù):Java網(wǎng)絡(luò)爬蟲(chóng)實(shí)戰(zhàn)
- 例說(shuō)FPGA:可直接用于工程項(xiàng)目的第一手經(jīng)驗(yàn)
- Learning Shiny
- Kotlin程序員面試算法寶典