- 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.
推薦閱讀
- 微服務與事件驅動架構
- C++面向對象程序設計(微課版)
- Web Development with Django Cookbook
- Python數據分析(第2版)
- Expert Data Visualization
- Apache Spark 2.x for Java Developers
- 執(zhí)劍而舞:用代碼創(chuàng)作藝術
- 計算機應用基礎案例教程
- Python全棧數據工程師養(yǎng)成攻略(視頻講解版)
- D3.js By Example
- 響應式Web設計:HTML5和CSS3實戰(zhàn)(第2版)
- 物聯(lián)網系統(tǒng)架構設計與邊緣計算(原書第2版)
- INSTANT JQuery Flot Visual Data Analysis
- 基于GPU加速的計算機視覺編程:使用OpenCV和CUDA實時處理復雜圖像數據
- Java 11 and 12:New Features