{"id":155,"date":"2021-07-08T16:45:47","date_gmt":"2021-07-08T13:45:47","guid":{"rendered":"https:\/\/ernan-maisels.net\/?p=155"},"modified":"2021-07-08T16:48:59","modified_gmt":"2021-07-08T13:48:59","slug":"memento","status":"publish","type":"post","link":"https:\/\/hernan-yehuda.net\/?p=155","title":{"rendered":"Memento"},"content":{"rendered":"\n<p>\u05de\u05de\u05e0\u05d8\u05d5 \u05d4\u05d9\u05d0 \u05ea\u05d1\u05e0\u05d9\u05ea \u05e2\u05d9\u05e6\u05d5\u05d1 \u05dc\u05de\u05d9\u05de\u05d5\u05e9 \u05de\u05e0\u05d2\u05e0\u05d5\u05df \u05e9\u05d9\u05d7\u05d6\u05d5\u05e8 \u2013 \u05db\u05dc\u05d5\u05de\u05e8 \u05dc\u05e2\u05e9\u05d5\u05ea undo \u05d0\u05d5 ctrl +z \u05dc\u05e4\u05e2\u05d5\u05dc\u05d4 \u05e9\u05e2\u05e9\u05d9\u05e0\u05d5.&nbsp;<\/p>\n\n\n\n<p>\u05dc\u05e4\u05e2\u05de\u05d9\u05dd \u05d4\u05ea\u05d1\u05e0\u05d9\u05ea \u05d4\u05d6\u05d5 \u05e0\u05e7\u05e8\u05d0\u05ea snapshot \u05d1\u05d2\u05dc\u05dc \u05e9\u05d4\u05d9\u05d0 \u05e9\u05d5\u05de\u05e8\u05ea &#8216;\u05ea\u05de\u05d5\u05e0\u05ea-\u05de\u05e6\u05d1&#8217; \u05e7\u05d5\u05d3\u05de\u05ea \u05d5\u05de\u05d0\u05e4\u05e9\u05e8\u05ea \u05dc\u05d7\u05d6\u05d5\u05e8 \u05d0\u05dc\u05d9\u05d4.&nbsp;<\/p>\n\n\n\n<p>\u05d4\u05d3\u05e8\u05da \u05d4\u05e0\u05d5\u05d7\u05d4 \u05d5\u05d4\u05de\u05e7\u05d5\u05d1\u05dc\u05ea \u05dc\u05d4\u05e1\u05d1\u05d9\u05e8 \u05ea\u05d1\u05e0\u05d9\u05ea \u05d6\u05d5 \u05d4\u05d9\u05d0 \u05e2\u05dc \u05d9\u05d3\u05d9 \u05d3\u05d5\u05d2\u05de\u05d0 \u05e9\u05dc \u05e2\u05d5\u05e8\u05da \u05d8\u05e7\u05e1\u05d8. &nbsp;<\/p>\n\n\n\n<p>&nbsp;\u05e0\u05e0\u05d9\u05d7 \u05e9\u05d9\u05e9 \u05dc\u05d9 \u05e2\u05d5\u05e8\u05da \u05d8\u05e7\u05e1\u05d8 \u05d4\u05de\u05de\u05d5\u05de\u05e9 \u05d1\u05e7\u05dc\u05d0\u05e1 \u05d1\u05e9\u05dd Editor \u05d0\u05d5 \u05db\u05e4\u05d9 \u05e9\u05d4\u05d5\u05d0 \u05e0\u05e7\u05e8\u05d0 \u05d1\u05de\u05e7\u05d5\u05e8 &#8211; Originator . \u05d0\u05db\u05e0\u05d9\u05e1 \u05dc\u05ea\u05d5\u05db\u05d5 \u05e2\u05e8\u05db\u05d9\u05dd \u05d1\u05d0\u05d5\u05e4\u05df \u05d4\u05d1\u05d0:&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n var editor = new Editor(); \n\neditor.Content = &quot;a&quot;; \neditor.Content = &quot;b&quot;; \neditor.Content = &quot;c&quot;; \n<\/pre><\/div>\n\n\n<p>\u05d5\u05d0\u05e0\u05d9 \u05de\u05e6\u05e4\u05d4 \u05e9\u05ea\u05d4\u05d9\u05d4 \u05dc\u05d9 \u05d0\u05e4\u05e9\u05e8\u05d5\u05ea \u05dc\u05d1\u05d8\u05dc \u05d0\u05ea \u05d4\u05e4\u05e2\u05d5\u05dc\u05d4 \/ \u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d4\u05d0\u05d7\u05e8\u05d5\u05e0\u05d5\u05ea. \u05dc\u05de\u05e9\u05dc \u05e9\u05ea\u05d4\u05d9\u05d4 \u05dc\u05d9 \u05de\u05ea\u05d5\u05d3\u05d4 \u05db\u05d6\u05d5:&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\neditor.undo(); \n<\/pre><\/div>\n\n\n<p>\u05d0\u05d9\u05da \u05d4\u05d9\u05d9\u05ea\u05dd \u05de\u05de\u05de\u05e9\u05d9\u05dd \u05de\u05e0\u05d2\u05e0\u05d5\u05df \u05db\u05d6\u05d4?&nbsp;<\/p>\n\n\n\n<p>\u05d0\u05dd \u05dc\u05de\u05e9\u05dc \u05d4\u05d9\u05d9\u05ea\u05d9 \u05de\u05d5\u05e1\u05d9\u05e3 \u05dc\u05e2\u05d5\u05e8\u05da \u05e9\u05dc\u05d9 \u05e9\u05d3\u05d4 \u05e0\u05d5\u05e1\u05e3 \u05de\u05e1\u05d5\u05d2 STRING \u05d1\u05e9\u05dd prevContent \u05d5\u05d1\u05db\u05dc \u05e4\u05e2\u05dd \u05e9\u05d0\u05e0\u05d9 \u05e8\u05d5\u05e6\u05d4 \u05dc\u05e9\u05e0\u05d5\u05ea \u05d0\u05ea \u05d4\u05e2\u05e8\u05da \u05e9\u05dc CONTENT \u05d4\u05d9\u05d9\u05ea\u05d9 \u05e9\u05d5\u05de\u05e8 \u05dc\u05e4\u05e0\u05d9 \u05d6\u05d4 \u05d0\u05ea \u05d4\u05e2\u05e8\u05da \u05d4\u05e0\u05d5\u05db\u05d7\u05d9 \u05d1\u05e9\u05d3\u05d4 \u05d4\u05d7\u05d3\u05e9, \u05d0\u05d6 \u05d4\u05d9\u05d9\u05ea\u05d9 \u05d9\u05db\u05d5\u05dc \u05dc\u05e2\u05e9\u05d5\u05ea UNDO \u05e8\u05e7 \u05e4\u05e2\u05dd \u05d0\u05d7\u05ea, \u05e8\u05e7 \u05e2\u05dc \u05d4\u05e9\u05d9\u05e0\u05d5\u05d9 \u05d4\u05d0\u05d7\u05e8\u05d5\u05df.&nbsp;<\/p>\n\n\n\n<p>\u05dc\u05db\u05df \u05d0\u05e0\u05d9 \u05e6\u05e8\u05d9\u05da \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05e2\u05e8\u05db\u05d9\u05dd \u05e7\u05d5\u05d3\u05de\u05d9\u05dd.&nbsp;<\/p>\n\n\n\n<p>\u05d0\u05d1\u05dc \u05d4\u05d4\u05d2\u05d9\u05d5\u05df \u05d0\u05d5\u05de\u05e8 \u05e9\u05d0\u05e0\u05d9 \u05dc\u05d0 \u05e8\u05d5\u05e6\u05d4 \u05e8\u05e7&nbsp; \u05d4\u05ea\u05d5\u05db\u05df, \u05d0\u05dc\u05d0 \u05d2\u05dd \u05d0\u05ea \u05d4\u05db\u05d5\u05ea\u05e8\u05ea, \u05d0\u05ea \u05e6\u05d1\u05e2 \u05d4\u05e8\u05e7\u05e2 \u05d5\u05db\u05d5&#8217; \u05d5\u05db\u05d5&#8217; &#8211; \u05db\u05e4\u05d9 \u05e9\u05d0\u05e0\u05d7\u05e0\u05d5 \u05e8\u05d2\u05d9\u05dc\u05d9\u05dd \u05d1\u05db\u05dc \u05ea\u05d5\u05db\u05e0\u05d4 \u05de\u05e6\u05d5\u05d9\u05d4 \u05d1\u05e9\u05d5\u05e7.&nbsp;<\/p>\n\n\n\n<p>\u05d0\u05d6 \u05de\u05d4 \u05e9\u05d9\u05e6\u05d0 \u05d6\u05d4 \u05e9\u05d0\u05e6\u05d8\u05e8\u05da \u05e2\u05dc \u05db\u05dc \u05d0\u05d7\u05d3 \u05de\u05d4\u05d0\u05d9\u05d1\u05e8\u05d9\u05dd \u05e9\u05dc \u05d4\u05e2\u05d5\u05e8\u05da \u05e9\u05dc\u05d9 \u05d2\u05dd \u05e9\u05d3\u05d4 \u05d1\u05e7\u05dc\u05d0\u05e1 \u05d5\u05d2\u05dd \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05db\u05dc \u05d4\u05de\u05e6\u05d1\u05d9\u05dd \u05d4\u05e7\u05d5\u05d3\u05de\u05d9\u05dd \u05e9\u05dc \u05d0\u05d5\u05ea\u05d5 \u05d4\u05e9\u05d3\u05d4. &nbsp;<\/p>\n\n\n\n<p>\u05db\u05dc\u05d5\u05de\u05e8 &#8211; \u05d4\u05e8\u05d1\u05d4 \u05e9\u05d3\u05d5\u05ea \u05d5\u05db\u05e0\u05d2\u05d3\u05dd \u05d4\u05e8\u05d1\u05d4 \u05e8\u05e9\u05d9\u05de\u05d5\u05ea. \u05e7\u05e6\u05ea \u05d1\u05dc\u05d0\u05d2\u05df.&nbsp;<\/p>\n\n\n\n<p>\u05d0\u05d6 \u05d0\u05d9\u05da \u05e0\u05e4\u05ea\u05d5\u05e8 \u05d0\u05ea \u05d6\u05d4?&nbsp;<\/p>\n\n\n\n<p>\u05e0\u05d9\u05e6\u05d5\u05e8 \u05e7\u05dc\u05d0\u05e1 \u05d7\u05d3\u05e9 \u05e9\u05de\u05d2\u05dc\u05dd \u05d0\u05ea \u05d4\u05de\u05e6\u05d1 \u05e9\u05dc \u05d4\u05e2\u05d5\u05e8\u05da \u05d1\u05e8\u05d2\u05e2 \u05e0\u05ea\u05d5\u05df. \u05e0\u05e7\u05e8\u05d0 \u05dc\u05d5 Memento. \u05e2\u05dc \u05e9\u05de\u05d5 \u05e0\u05e7\u05e8\u05d0\u05ea \u05d4\u05ea\u05d1\u05e0\u05d9\u05ea \u05d4\u05d6\u05d5 \u05db\u05d9 \u05d4\u05d5\u05d0 \u05de\u05ea\u05d0\u05e8 \u05d0\u05ea \u05d4\u05e8\u05d2\u05e2 \u05d4\u05e0\u05ea\u05d5\u05df \u05d4\u05e1\u05e4\u05e6\u05d9\u05e4\u05d9.&nbsp;<\/p>\n\n\n\n<p>\u05de\u05d4 \u05e9\u05e0\u05e6\u05d8\u05e8\u05da \u05dc\u05d4\u05d7\u05d6\u05d9\u05e7 \u05db\u05e8\u05d2\u05e2 \u05d4\u05d5\u05d0 \u05e8\u05e7 \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05d4\u05e7\u05dc\u05d0\u05e1 \u05d4\u05d7\u05d3\u05e9 \u05e9\u05dc\u05e0\u05d5.&nbsp;<\/p>\n\n\n\n<p>\u05d6\u05d4\u05d5 \u05e4\u05d9\u05ea\u05e8\u05d5\u05df \u05d8\u05d5\u05d1 \u05d9\u05d5\u05ea\u05e8 \u05d1\u05d2\u05dc\u05dc &nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u05e9\u05d4\u05d5\u05d0 \u05de\u05d0\u05e4\u05e9\u05e8 \u05dc\u05e0\u05d5 \u05dc\u05dc\u05db\u05ea \u05d0\u05d7\u05d5\u05e8\u05d4 \u05d4\u05e8\u05d1\u05d4 \u05e4\u05e2\u05de\u05d9\u05dd &nbsp;<\/li><li>\u05d5\u05d1\u05d2\u05dc\u05dc \u05e9\u05d0\u05e0\u05d7\u05e0\u05d5 \u05dc\u05d0 \u05de\u05e4\u05d5\u05e6\u05e6\u05d9\u05dd \u05d0\u05ea \u05d4\u05e2\u05d5\u05e8\u05da \u05d1\u05d9\u05d5\u05ea\u05e8 \u05de\u05d3\u05d9 \u05e9\u05d3\u05d5\u05ea.&nbsp;<\/li><\/ol>\n\n\n\n<p>\u05d0\u05d1\u05dc \u05e2\u05d3\u05d9\u05d9\u05df \u05d9\u05e9 \u05dc\u05e0\u05d5 \u05d1\u05e2\u05d9\u05d9\u05d4. \u05d4\u05e4\u05d9\u05ea\u05e8\u05d5\u05df \u05d4\u05d6\u05d4 \u05de\u05e4\u05e8 \u05d0\u05ea \u05d4\u05e2\u05e7\u05e8\u05d5\u05df \u05d4\u05e0\u05e7\u05e8\u05d0 SRP &#8211; .&nbsp;<\/p>\n\n\n\n<p>Single Responsibility Principle&nbsp;<\/p>\n\n\n\n<p>\u05d4\u05e2\u05e7\u05e8\u05d5\u05df \u05d4\u05d6\u05d4 \u05d0\u05d5\u05de\u05e8 \u05e9\u05dc\u05db\u05dc \u05e7\u05dc\u05d0\u05e1 \u05e6\u05e8\u05d9\u05db\u05d4 \u05dc\u05d4\u05d9\u05d5\u05ea \u05e8\u05e7 \u05d0\u05d7\u05e8\u05d9\u05d5\u05ea \u05d0\u05d7\u05ea. \u05d5\u05d4\u05e7\u05dc\u05d0\u05e1 \u05e9\u05dc\u05e0\u05d5 \u05d4\u05d5\u05d0 \u05d2\u05dd \u05e2\u05d5\u05e8\u05da, \u05d0\u05da \u05d4\u05d5\u05d0 \u05d2\u05dd \u05e9\u05d5\u05de\u05e8 \u05e2\u05dc \u05d4\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4. &nbsp;<\/p>\n\n\n\n<p>\u05d0\u05dd \u05db\u05da &#8211; \u05e0\u05e8\u05e6\u05d4 \u05dc\u05e9\u05de\u05d5\u05e8 \u05d0\u05ea \u05d4\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4 \u05d1\u05e7\u05dc\u05d0\u05e1 \u05e0\u05e4\u05e8\u05d3.&nbsp;<\/p>\n\n\n\n<p>\u05e0\u05d9\u05e6\u05d5\u05e8 \u05e7\u05dc\u05d0\u05e1 \u05d7\u05d3\u05e9 \u05d1\u05e9\u05dd CareTaker, \u05d5\u05dc\u05e7\u05dc\u05d0\u05e1 \u05d6\u05d4 \u05ea\u05d4\u05d9\u05d4 \u05e8\u05e7 \u05d0\u05d7\u05e8\u05d9\u05d5\u05ea \u05d0\u05d7\u05ea &#8211; \u05e9\u05de\u05d9\u05e8\u05ea \u05d4\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4 .&nbsp;<\/p>\n\n\n\n<p>\u05d4\u05e7\u05dc\u05d0\u05e1 \u05d4\u05d6\u05d4 \u05d9\u05db\u05d9\u05dc \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc Memento.&nbsp;<\/p>\n\n\n\n<p>\u05db\u05de\u05d5 \u05db\u05df \u05e0\u05e6\u05d8\u05e8\u05da \u05e9\u05ea\u05d9 \u05de\u05ea\u05d5\u05d3\u05d5\u05ea \u05e9\u05dc \u05d4\u05db\u05e0\u05e1\u05d4 \u05dc\u05e8\u05e9\u05d9\u05de\u05d4 \u05d5\u05d4\u05d5\u05e6\u05d0\u05d4 \u05de\u05de\u05e0\u05d4.&nbsp;<\/p>\n\n\n\n<p>\u05e2\u05db\u05e9\u05d9\u05d5 \u05d4\u05e2\u05d5\u05e8\u05da \u05d4\u05e8\u05d0\u05e9\u05d9 \u05e9\u05dc\u05e0\u05d5 \u05d9\u05e6\u05d8\u05e8\u05da \u05e9\u05ea\u05d9 \u05de\u05ea\u05d5\u05d3\u05d5\u05ea \u05d7\u05d3\u05e9\u05d5\u05ea &#8211; CreateState \u05d5 RestoreState.&nbsp;<\/p>\n\n\n\n<p>\u05d4\u05d9\u05d7\u05e1\u05d9\u05dd \u05d1\u05d9\u05df \u05db\u05dc \u05d4\u05de\u05d7\u05dc\u05e7\u05d5\u05ea \u05d9\u05e8\u05d0\u05d4 \u05db\u05da:&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"355\" height=\"402\" src=\"https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1.png\" alt=\"\" class=\"wp-image-156\" srcset=\"https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1.png 355w, https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1-265x300.png 265w, https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1-21x24.png 21w, https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1-32x36.png 32w, https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1-42x48.png 42w\" sizes=\"(max-width: 355px) 100vw, 355px\" \/><\/figure>\n\n\n\n<p>\u05d4\u05de\u05d9\u05de\u05d5\u05e9 \u05d1\u05e7\u05d5\u05d3 \u05d9\u05d4\u05d9\u05d4 \u05db\u05da:&nbsp;<\/p>\n\n\n\n<p>\u05ea\u05d4\u05d9\u05d4 \u05dc\u05e0\u05d5 \u05de\u05d7\u05dc\u05e7\u05d4 \u05de\u05e7\u05d5\u05e8\u05d9\u05ea \u05e9\u05dc \u05d4\u05e2\u05d5\u05e8\u05da:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nclass Originator\n    {\n        public string Content { get; set; }\n\n        public Memento CreateState()\n        {\n            return new Memento(Content);\n        }\n\n        public void Restore(Memento state)\n        {\n            Content = state.Content;\n        }\n\n        public string GetContent()\n        {\n            return Content;\n        }\n    }\n<\/pre><\/div>\n\n\n<p>\u05db\u05de\u05d5\u05d1\u05df, \u05ea\u05d4\u05d9\u05d4 \u05dc\u05e0\u05d5 \u05de\u05d7\u05dc\u05e7\u05ea \u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4 \u05d4\u05e0\u05e7\u05e8\u05d0\u05ea Memento:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic class Memento\n    {\n        public readonly string Content;\n\n        public Memento(string content)\n        {\n            Content = content;\n        }\n\n\n    }\n<\/pre><\/div>\n\n\n<p>\u05d5\u05ea\u05d4\u05d9\u05d4 \u05dc\u05e0\u05d5 \u05de\u05d7\u05dc\u05e7\u05ea \u05e2\u05d6\u05e8 \u05dc\u05e0\u05d9\u05d4\u05d5\u05dc \u05d4List.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n class Caretaker\n    {\n        private List&lt;Memento&gt; mementoes = new List&lt;Memento&gt;();\n\n        public void Push(Memento state)\n        {\n            mementoes.Add(state);\n        }\n\n        public Memento Pop()\n        {\n            var lastIndex = mementoes.Count - 1;\n            var lastState = mementoes&#x5B;lastIndex];\n            mementoes.Remove(lastState);\n            return lastState;\n        }\n    }\n<\/pre><\/div>\n\n\n<p>\u05e0\u05d5\u05db\u05dc \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d1\u05e7\u05d5\u05d3 \u05d1\u05d0\u05d5\u05e4\u05df \u05d4\u05d1\u05d0:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nclass Program\n    {\n        static void Main(string&#x5B;] args)\n        {\n            var editor = new Originator();\n            var history = new Caretaker();\n\n            editor.Content = &quot;a&quot;;\n            history.Push(editor.CreateState());\n          \n            editor.Content = &quot;b&quot;;\n            history.Push(editor.CreateState());\n            \n            editor.Content = &quot;c&quot;;\n            editor.Restore(history.Pop());\n\n            Console.WriteLine(editor.Content);\n        }\n    }\n<\/pre><\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u05de\u05de\u05e0\u05d8\u05d5 \u05d4\u05d9\u05d0 \u05ea\u05d1\u05e0\u05d9\u05ea \u05e2\u05d9\u05e6\u05d5\u05d1 \u05dc\u05de\u05d9\u05de\u05d5\u05e9 \u05de\u05e0\u05d2\u05e0\u05d5\u05df \u05e9\u05d9\u05d7\u05d6\u05d5\u05e8 \u2013 \u05db\u05dc\u05d5\u05de\u05e8 \u05dc\u05e2\u05e9\u05d5\u05ea undo \u05d0\u05d5 ctrl +z \u05dc\u05e4\u05e2\u05d5\u05dc\u05d4 \u05e9\u05e2\u05e9\u05d9\u05e0\u05d5.&nbsp; \u05dc\u05e4\u05e2\u05de\u05d9\u05dd \u05d4\u05ea\u05d1\u05e0\u05d9\u05ea \u05d4\u05d6\u05d5 \u05e0\u05e7\u05e8\u05d0\u05ea snapshot \u05d1\u05d2\u05dc\u05dc \u05e9\u05d4\u05d9\u05d0 \u05e9\u05d5\u05de\u05e8\u05ea &#8216;\u05ea\u05de\u05d5\u05e0\u05ea-\u05de\u05e6\u05d1&#8217; \u05e7\u05d5\u05d3\u05de\u05ea \u05d5\u05de\u05d0\u05e4\u05e9\u05e8\u05ea \u05dc\u05d7\u05d6\u05d5\u05e8 \u05d0\u05dc\u05d9\u05d4.&nbsp; \u05d4\u05d3\u05e8\u05da \u05d4\u05e0\u05d5\u05d7\u05d4 \u05d5\u05d4\u05de\u05e7\u05d5\u05d1\u05dc\u05ea \u05dc\u05d4\u05e1\u05d1\u05d9\u05e8 \u05ea\u05d1\u05e0\u05d9\u05ea \u05d6\u05d5 \u05d4\u05d9\u05d0 \u05e2\u05dc \u05d9\u05d3\u05d9 \u05d3\u05d5\u05d2\u05de\u05d0 \u05e9\u05dc \u05e2\u05d5\u05e8\u05da \u05d8\u05e7\u05e1\u05d8. &nbsp; &nbsp;\u05e0\u05e0\u05d9\u05d7 \u05e9\u05d9\u05e9 \u05dc\u05d9 \u05e2\u05d5\u05e8\u05da \u05d8\u05e7\u05e1\u05d8 \u05d4\u05de\u05de\u05d5\u05de\u05e9 \u05d1\u05e7\u05dc\u05d0\u05e1 \u05d1\u05e9\u05dd Editor \u05d0\u05d5 \u05db\u05e4\u05d9 \u05e9\u05d4\u05d5\u05d0 \u05e0\u05e7\u05e8\u05d0 \u05d1\u05de\u05e7\u05d5\u05e8 &#8211; Originator . \u05d0\u05db\u05e0\u05d9\u05e1 \u05dc\u05ea\u05d5\u05db\u05d5 \u05e2\u05e8\u05db\u05d9\u05dd \u05d1\u05d0\u05d5\u05e4\u05df \u05d4\u05d1\u05d0:&nbsp; \u05d5\u05d0\u05e0\u05d9 \u05de\u05e6\u05e4\u05d4 \u05e9\u05ea\u05d4\u05d9\u05d4 \u05dc\u05d9 \u05d0\u05e4\u05e9\u05e8\u05d5\u05ea \u05dc\u05d1\u05d8\u05dc \u05d0\u05ea \u05d4\u05e4\u05e2\u05d5\u05dc\u05d4 \/ \u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d4\u05d0\u05d7\u05e8\u05d5\u05e0\u05d5\u05ea. \u05dc\u05de\u05e9\u05dc \u05e9\u05ea\u05d4\u05d9\u05d4 \u05dc\u05d9 \u05de\u05ea\u05d5\u05d3\u05d4 \u05db\u05d6\u05d5:&nbsp; \u05d0\u05d9\u05da \u05d4\u05d9\u05d9\u05ea\u05dd \u05de\u05de\u05de\u05e9\u05d9\u05dd \u05de\u05e0\u05d2\u05e0\u05d5\u05df \u05db\u05d6\u05d4?&nbsp; \u05d0\u05dd \u05dc\u05de\u05e9\u05dc \u05d4\u05d9\u05d9\u05ea\u05d9 \u05de\u05d5\u05e1\u05d9\u05e3 \u05dc\u05e2\u05d5\u05e8\u05da \u05e9\u05dc\u05d9 \u05e9\u05d3\u05d4 \u05e0\u05d5\u05e1\u05e3 \u05de\u05e1\u05d5\u05d2 STRING \u05d1\u05e9\u05dd prevContent \u05d5\u05d1\u05db\u05dc \u05e4\u05e2\u05dd \u05e9\u05d0\u05e0\u05d9 \u05e8\u05d5\u05e6\u05d4 \u05dc\u05e9\u05e0\u05d5\u05ea \u05d0\u05ea \u05d4\u05e2\u05e8\u05da \u05e9\u05dc CONTENT \u05d4\u05d9\u05d9\u05ea\u05d9 \u05e9\u05d5\u05de\u05e8 \u05dc\u05e4\u05e0\u05d9 \u05d6\u05d4 \u05d0\u05ea \u05d4\u05e2\u05e8\u05da \u05d4\u05e0\u05d5\u05db\u05d7\u05d9 \u05d1\u05e9\u05d3\u05d4 \u05d4\u05d7\u05d3\u05e9, \u05d0\u05d6 \u05d4\u05d9\u05d9\u05ea\u05d9 \u05d9\u05db\u05d5\u05dc \u05dc\u05e2\u05e9\u05d5\u05ea UNDO \u05e8\u05e7 \u05e4\u05e2\u05dd \u05d0\u05d7\u05ea, \u05e8\u05e7 \u05e2\u05dc \u05d4\u05e9\u05d9\u05e0\u05d5\u05d9 \u05d4\u05d0\u05d7\u05e8\u05d5\u05df.&nbsp; \u05dc\u05db\u05df \u05d0\u05e0\u05d9 \u05e6\u05e8\u05d9\u05da \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05e2\u05e8\u05db\u05d9\u05dd \u05e7\u05d5\u05d3\u05de\u05d9\u05dd.&nbsp; \u05d0\u05d1\u05dc \u05d4\u05d4\u05d2\u05d9\u05d5\u05df \u05d0\u05d5\u05de\u05e8 \u05e9\u05d0\u05e0\u05d9 \u05dc\u05d0 \u05e8\u05d5\u05e6\u05d4 \u05e8\u05e7&nbsp; \u05d4\u05ea\u05d5\u05db\u05df, \u05d0\u05dc\u05d0 \u05d2\u05dd \u05d0\u05ea \u05d4\u05db\u05d5\u05ea\u05e8\u05ea, \u05d0\u05ea \u05e6\u05d1\u05e2 \u05d4\u05e8\u05e7\u05e2 \u05d5\u05db\u05d5&#8217; \u05d5\u05db\u05d5&#8217; &#8211; \u05db\u05e4\u05d9 \u05e9\u05d0\u05e0\u05d7\u05e0\u05d5 \u05e8\u05d2\u05d9\u05dc\u05d9\u05dd \u05d1\u05db\u05dc \u05ea\u05d5\u05db\u05e0\u05d4 \u05de\u05e6\u05d5\u05d9\u05d4 \u05d1\u05e9\u05d5\u05e7.&nbsp; \u05d0\u05d6 \u05de\u05d4 \u05e9\u05d9\u05e6\u05d0 \u05d6\u05d4 \u05e9\u05d0\u05e6\u05d8\u05e8\u05da \u05e2\u05dc \u05db\u05dc \u05d0\u05d7\u05d3 \u05de\u05d4\u05d0\u05d9\u05d1\u05e8\u05d9\u05dd \u05e9\u05dc \u05d4\u05e2\u05d5\u05e8\u05da \u05e9\u05dc\u05d9 \u05d2\u05dd \u05e9\u05d3\u05d4 \u05d1\u05e7\u05dc\u05d0\u05e1 \u05d5\u05d2\u05dd \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05db\u05dc \u05d4\u05de\u05e6\u05d1\u05d9\u05dd \u05d4\u05e7\u05d5\u05d3\u05de\u05d9\u05dd \u05e9\u05dc \u05d0\u05d5\u05ea\u05d5 \u05d4\u05e9\u05d3\u05d4. &nbsp; \u05db\u05dc\u05d5\u05de\u05e8 &#8211; \u05d4\u05e8\u05d1\u05d4 \u05e9\u05d3\u05d5\u05ea \u05d5\u05db\u05e0\u05d2\u05d3\u05dd \u05d4\u05e8\u05d1\u05d4 \u05e8\u05e9\u05d9\u05de\u05d5\u05ea. \u05e7\u05e6\u05ea \u05d1\u05dc\u05d0\u05d2\u05df.&nbsp; \u05d0\u05d6 \u05d0\u05d9\u05da \u05e0\u05e4\u05ea\u05d5\u05e8 \u05d0\u05ea \u05d6\u05d4?&nbsp; \u05e0\u05d9\u05e6\u05d5\u05e8 \u05e7\u05dc\u05d0\u05e1 \u05d7\u05d3\u05e9 \u05e9\u05de\u05d2\u05dc\u05dd \u05d0\u05ea \u05d4\u05de\u05e6\u05d1 \u05e9\u05dc \u05d4\u05e2\u05d5\u05e8\u05da \u05d1\u05e8\u05d2\u05e2 \u05e0\u05ea\u05d5\u05df. \u05e0\u05e7\u05e8\u05d0 \u05dc\u05d5 Memento. \u05e2\u05dc \u05e9\u05de\u05d5 \u05e0\u05e7\u05e8\u05d0\u05ea \u05d4\u05ea\u05d1\u05e0\u05d9\u05ea \u05d4\u05d6\u05d5 \u05db\u05d9 \u05d4\u05d5\u05d0 \u05de\u05ea\u05d0\u05e8 \u05d0\u05ea \u05d4\u05e8\u05d2\u05e2 \u05d4\u05e0\u05ea\u05d5\u05df \u05d4\u05e1\u05e4\u05e6\u05d9\u05e4\u05d9.&nbsp; \u05de\u05d4 \u05e9\u05e0\u05e6\u05d8\u05e8\u05da \u05dc\u05d4\u05d7\u05d6\u05d9\u05e7 \u05db\u05e8\u05d2\u05e2 \u05d4\u05d5\u05d0 \u05e8\u05e7 \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05d4\u05e7\u05dc\u05d0\u05e1 \u05d4\u05d7\u05d3\u05e9 \u05e9\u05dc\u05e0\u05d5.&nbsp; \u05d6\u05d4\u05d5 \u05e4\u05d9\u05ea\u05e8\u05d5\u05df \u05d8\u05d5\u05d1 \u05d9\u05d5\u05ea\u05e8 \u05d1\u05d2\u05dc\u05dc &nbsp; \u05e9\u05d4\u05d5\u05d0 \u05de\u05d0\u05e4\u05e9\u05e8 \u05dc\u05e0\u05d5 \u05dc\u05dc\u05db\u05ea \u05d0\u05d7\u05d5\u05e8\u05d4 \u05d4\u05e8\u05d1\u05d4 \u05e4\u05e2\u05de\u05d9\u05dd &nbsp; \u05d5\u05d1\u05d2\u05dc\u05dc \u05e9\u05d0\u05e0\u05d7\u05e0\u05d5 \u05dc\u05d0 \u05de\u05e4\u05d5\u05e6\u05e6\u05d9\u05dd \u05d0\u05ea \u05d4\u05e2\u05d5\u05e8\u05da \u05d1\u05d9\u05d5\u05ea\u05e8 \u05de\u05d3\u05d9 \u05e9\u05d3\u05d5\u05ea.&nbsp; \u05d0\u05d1\u05dc \u05e2\u05d3\u05d9\u05d9\u05df \u05d9\u05e9 \u05dc\u05e0\u05d5 \u05d1\u05e2\u05d9\u05d9\u05d4. \u05d4\u05e4\u05d9\u05ea\u05e8\u05d5\u05df \u05d4\u05d6\u05d4 \u05de\u05e4\u05e8 \u05d0\u05ea \u05d4\u05e2\u05e7\u05e8\u05d5\u05df \u05d4\u05e0\u05e7\u05e8\u05d0 SRP &#8211; .&nbsp; Single Responsibility Principle&nbsp; \u05d4\u05e2\u05e7\u05e8\u05d5\u05df \u05d4\u05d6\u05d4 \u05d0\u05d5\u05de\u05e8 \u05e9\u05dc\u05db\u05dc \u05e7\u05dc\u05d0\u05e1 \u05e6\u05e8\u05d9\u05db\u05d4 \u05dc\u05d4\u05d9\u05d5\u05ea \u05e8\u05e7 \u05d0\u05d7\u05e8\u05d9\u05d5\u05ea \u05d0\u05d7\u05ea. \u05d5\u05d4\u05e7\u05dc\u05d0\u05e1 \u05e9\u05dc\u05e0\u05d5 \u05d4\u05d5\u05d0 \u05d2\u05dd \u05e2\u05d5\u05e8\u05da, \u05d0\u05da \u05d4\u05d5\u05d0 \u05d2\u05dd \u05e9\u05d5\u05de\u05e8 \u05e2\u05dc \u05d4\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4. &nbsp; \u05d0\u05dd \u05db\u05da &#8211; \u05e0\u05e8\u05e6\u05d4 \u05dc\u05e9\u05de\u05d5\u05e8 \u05d0\u05ea \u05d4\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4 \u05d1\u05e7\u05dc\u05d0\u05e1 \u05e0\u05e4\u05e8\u05d3.&nbsp; \u05e0\u05d9\u05e6\u05d5\u05e8 \u05e7\u05dc\u05d0\u05e1 \u05d7\u05d3\u05e9 \u05d1\u05e9\u05dd CareTaker, \u05d5\u05dc\u05e7\u05dc\u05d0\u05e1 \u05d6\u05d4 \u05ea\u05d4\u05d9\u05d4 \u05e8\u05e7 \u05d0\u05d7\u05e8\u05d9\u05d5\u05ea \u05d0\u05d7\u05ea &#8211; \u05e9\u05de\u05d9\u05e8\u05ea \u05d4\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4 .&nbsp; \u05d4\u05e7\u05dc\u05d0\u05e1 \u05d4\u05d6\u05d4 \u05d9\u05db\u05d9\u05dc \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc Memento.&nbsp; \u05db\u05de\u05d5 \u05db\u05df \u05e0\u05e6\u05d8\u05e8\u05da \u05e9\u05ea\u05d9 \u05de\u05ea\u05d5\u05d3\u05d5\u05ea \u05e9\u05dc \u05d4\u05db\u05e0\u05e1\u05d4 \u05dc\u05e8\u05e9\u05d9\u05de\u05d4 \u05d5\u05d4\u05d5\u05e6\u05d0\u05d4 \u05de\u05de\u05e0\u05d4.&nbsp; \u05e2\u05db\u05e9\u05d9\u05d5 \u05d4\u05e2\u05d5\u05e8\u05da \u05d4\u05e8\u05d0\u05e9\u05d9 \u05e9\u05dc\u05e0\u05d5 \u05d9\u05e6\u05d8\u05e8\u05da \u05e9\u05ea\u05d9 \u05de\u05ea\u05d5\u05d3\u05d5\u05ea \u05d7\u05d3\u05e9\u05d5\u05ea &#8211; CreateState \u05d5 RestoreState.&nbsp; \u05d4\u05d9\u05d7\u05e1\u05d9\u05dd \u05d1\u05d9\u05df \u05db\u05dc \u05d4\u05de\u05d7\u05dc\u05e7\u05d5\u05ea \u05d9\u05e8\u05d0\u05d4 \u05db\u05da:&nbsp; \u05d4\u05de\u05d9\u05de\u05d5\u05e9 \u05d1\u05e7\u05d5\u05d3 \u05d9\u05d4\u05d9\u05d4 \u05db\u05da:&nbsp; \u05ea\u05d4\u05d9\u05d4 \u05dc\u05e0\u05d5 \u05de\u05d7\u05dc\u05e7\u05d4 \u05de\u05e7\u05d5\u05e8\u05d9\u05ea \u05e9\u05dc \u05d4\u05e2\u05d5\u05e8\u05da: \u05db\u05de\u05d5\u05d1\u05df, \u05ea\u05d4\u05d9\u05d4 \u05dc\u05e0\u05d5 \u05de\u05d7\u05dc\u05e7\u05ea \u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4 \u05d4\u05e0\u05e7\u05e8\u05d0\u05ea Memento: \u05d5\u05ea\u05d4\u05d9\u05d4 \u05dc\u05e0\u05d5 \u05de\u05d7\u05dc\u05e7\u05ea \u05e2\u05d6\u05e8 \u05dc\u05e0\u05d9\u05d4\u05d5\u05dc \u05d4List. \u05e0\u05d5\u05db\u05dc \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d1\u05e7\u05d5\u05d3 \u05d1\u05d0\u05d5\u05e4\u05df \u05d4\u05d1\u05d0:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,1],"tags":[5,15,4],"class_list":["post-155","post","type-post","status-publish","format-standard","hentry","category-designpatterns","category-solid","tag-design-patterns","tag-memento","tag-solid"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Memento - Design for Living<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hernan-yehuda.net\/?p=155\" \/>\n<meta property=\"og:locale\" content=\"he_IL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Memento - Design for Living\" \/>\n<meta property=\"og:description\" content=\"\u05de\u05de\u05e0\u05d8\u05d5 \u05d4\u05d9\u05d0 \u05ea\u05d1\u05e0\u05d9\u05ea \u05e2\u05d9\u05e6\u05d5\u05d1 \u05dc\u05de\u05d9\u05de\u05d5\u05e9 \u05de\u05e0\u05d2\u05e0\u05d5\u05df \u05e9\u05d9\u05d7\u05d6\u05d5\u05e8 \u2013 \u05db\u05dc\u05d5\u05de\u05e8 \u05dc\u05e2\u05e9\u05d5\u05ea undo \u05d0\u05d5 ctrl +z \u05dc\u05e4\u05e2\u05d5\u05dc\u05d4 \u05e9\u05e2\u05e9\u05d9\u05e0\u05d5.&nbsp; \u05dc\u05e4\u05e2\u05de\u05d9\u05dd \u05d4\u05ea\u05d1\u05e0\u05d9\u05ea \u05d4\u05d6\u05d5 \u05e0\u05e7\u05e8\u05d0\u05ea snapshot \u05d1\u05d2\u05dc\u05dc \u05e9\u05d4\u05d9\u05d0 \u05e9\u05d5\u05de\u05e8\u05ea &#8216;\u05ea\u05de\u05d5\u05e0\u05ea-\u05de\u05e6\u05d1&#8217; \u05e7\u05d5\u05d3\u05de\u05ea \u05d5\u05de\u05d0\u05e4\u05e9\u05e8\u05ea \u05dc\u05d7\u05d6\u05d5\u05e8 \u05d0\u05dc\u05d9\u05d4.&nbsp; \u05d4\u05d3\u05e8\u05da \u05d4\u05e0\u05d5\u05d7\u05d4 \u05d5\u05d4\u05de\u05e7\u05d5\u05d1\u05dc\u05ea \u05dc\u05d4\u05e1\u05d1\u05d9\u05e8 \u05ea\u05d1\u05e0\u05d9\u05ea \u05d6\u05d5 \u05d4\u05d9\u05d0 \u05e2\u05dc \u05d9\u05d3\u05d9 \u05d3\u05d5\u05d2\u05de\u05d0 \u05e9\u05dc \u05e2\u05d5\u05e8\u05da \u05d8\u05e7\u05e1\u05d8. &nbsp; &nbsp;\u05e0\u05e0\u05d9\u05d7 \u05e9\u05d9\u05e9 \u05dc\u05d9 \u05e2\u05d5\u05e8\u05da \u05d8\u05e7\u05e1\u05d8 \u05d4\u05de\u05de\u05d5\u05de\u05e9 \u05d1\u05e7\u05dc\u05d0\u05e1 \u05d1\u05e9\u05dd Editor \u05d0\u05d5 \u05db\u05e4\u05d9 \u05e9\u05d4\u05d5\u05d0 \u05e0\u05e7\u05e8\u05d0 \u05d1\u05de\u05e7\u05d5\u05e8 &#8211; Originator . \u05d0\u05db\u05e0\u05d9\u05e1 \u05dc\u05ea\u05d5\u05db\u05d5 \u05e2\u05e8\u05db\u05d9\u05dd \u05d1\u05d0\u05d5\u05e4\u05df \u05d4\u05d1\u05d0:&nbsp; \u05d5\u05d0\u05e0\u05d9 \u05de\u05e6\u05e4\u05d4 \u05e9\u05ea\u05d4\u05d9\u05d4 \u05dc\u05d9 \u05d0\u05e4\u05e9\u05e8\u05d5\u05ea \u05dc\u05d1\u05d8\u05dc \u05d0\u05ea \u05d4\u05e4\u05e2\u05d5\u05dc\u05d4 \/ \u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d4\u05d0\u05d7\u05e8\u05d5\u05e0\u05d5\u05ea. \u05dc\u05de\u05e9\u05dc \u05e9\u05ea\u05d4\u05d9\u05d4 \u05dc\u05d9 \u05de\u05ea\u05d5\u05d3\u05d4 \u05db\u05d6\u05d5:&nbsp; \u05d0\u05d9\u05da \u05d4\u05d9\u05d9\u05ea\u05dd \u05de\u05de\u05de\u05e9\u05d9\u05dd \u05de\u05e0\u05d2\u05e0\u05d5\u05df \u05db\u05d6\u05d4?&nbsp; \u05d0\u05dd \u05dc\u05de\u05e9\u05dc \u05d4\u05d9\u05d9\u05ea\u05d9 \u05de\u05d5\u05e1\u05d9\u05e3 \u05dc\u05e2\u05d5\u05e8\u05da \u05e9\u05dc\u05d9 \u05e9\u05d3\u05d4 \u05e0\u05d5\u05e1\u05e3 \u05de\u05e1\u05d5\u05d2 STRING \u05d1\u05e9\u05dd prevContent \u05d5\u05d1\u05db\u05dc \u05e4\u05e2\u05dd \u05e9\u05d0\u05e0\u05d9 \u05e8\u05d5\u05e6\u05d4 \u05dc\u05e9\u05e0\u05d5\u05ea \u05d0\u05ea \u05d4\u05e2\u05e8\u05da \u05e9\u05dc CONTENT \u05d4\u05d9\u05d9\u05ea\u05d9 \u05e9\u05d5\u05de\u05e8 \u05dc\u05e4\u05e0\u05d9 \u05d6\u05d4 \u05d0\u05ea \u05d4\u05e2\u05e8\u05da \u05d4\u05e0\u05d5\u05db\u05d7\u05d9 \u05d1\u05e9\u05d3\u05d4 \u05d4\u05d7\u05d3\u05e9, \u05d0\u05d6 \u05d4\u05d9\u05d9\u05ea\u05d9 \u05d9\u05db\u05d5\u05dc \u05dc\u05e2\u05e9\u05d5\u05ea UNDO \u05e8\u05e7 \u05e4\u05e2\u05dd \u05d0\u05d7\u05ea, \u05e8\u05e7 \u05e2\u05dc \u05d4\u05e9\u05d9\u05e0\u05d5\u05d9 \u05d4\u05d0\u05d7\u05e8\u05d5\u05df.&nbsp; \u05dc\u05db\u05df \u05d0\u05e0\u05d9 \u05e6\u05e8\u05d9\u05da \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05e2\u05e8\u05db\u05d9\u05dd \u05e7\u05d5\u05d3\u05de\u05d9\u05dd.&nbsp; \u05d0\u05d1\u05dc \u05d4\u05d4\u05d2\u05d9\u05d5\u05df \u05d0\u05d5\u05de\u05e8 \u05e9\u05d0\u05e0\u05d9 \u05dc\u05d0 \u05e8\u05d5\u05e6\u05d4 \u05e8\u05e7&nbsp; \u05d4\u05ea\u05d5\u05db\u05df, \u05d0\u05dc\u05d0 \u05d2\u05dd \u05d0\u05ea \u05d4\u05db\u05d5\u05ea\u05e8\u05ea, \u05d0\u05ea \u05e6\u05d1\u05e2 \u05d4\u05e8\u05e7\u05e2 \u05d5\u05db\u05d5&#8217; \u05d5\u05db\u05d5&#8217; &#8211; \u05db\u05e4\u05d9 \u05e9\u05d0\u05e0\u05d7\u05e0\u05d5 \u05e8\u05d2\u05d9\u05dc\u05d9\u05dd \u05d1\u05db\u05dc \u05ea\u05d5\u05db\u05e0\u05d4 \u05de\u05e6\u05d5\u05d9\u05d4 \u05d1\u05e9\u05d5\u05e7.&nbsp; \u05d0\u05d6 \u05de\u05d4 \u05e9\u05d9\u05e6\u05d0 \u05d6\u05d4 \u05e9\u05d0\u05e6\u05d8\u05e8\u05da \u05e2\u05dc \u05db\u05dc \u05d0\u05d7\u05d3 \u05de\u05d4\u05d0\u05d9\u05d1\u05e8\u05d9\u05dd \u05e9\u05dc \u05d4\u05e2\u05d5\u05e8\u05da \u05e9\u05dc\u05d9 \u05d2\u05dd \u05e9\u05d3\u05d4 \u05d1\u05e7\u05dc\u05d0\u05e1 \u05d5\u05d2\u05dd \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05db\u05dc \u05d4\u05de\u05e6\u05d1\u05d9\u05dd \u05d4\u05e7\u05d5\u05d3\u05de\u05d9\u05dd \u05e9\u05dc \u05d0\u05d5\u05ea\u05d5 \u05d4\u05e9\u05d3\u05d4. &nbsp; \u05db\u05dc\u05d5\u05de\u05e8 &#8211; \u05d4\u05e8\u05d1\u05d4 \u05e9\u05d3\u05d5\u05ea \u05d5\u05db\u05e0\u05d2\u05d3\u05dd \u05d4\u05e8\u05d1\u05d4 \u05e8\u05e9\u05d9\u05de\u05d5\u05ea. \u05e7\u05e6\u05ea \u05d1\u05dc\u05d0\u05d2\u05df.&nbsp; \u05d0\u05d6 \u05d0\u05d9\u05da \u05e0\u05e4\u05ea\u05d5\u05e8 \u05d0\u05ea \u05d6\u05d4?&nbsp; \u05e0\u05d9\u05e6\u05d5\u05e8 \u05e7\u05dc\u05d0\u05e1 \u05d7\u05d3\u05e9 \u05e9\u05de\u05d2\u05dc\u05dd \u05d0\u05ea \u05d4\u05de\u05e6\u05d1 \u05e9\u05dc \u05d4\u05e2\u05d5\u05e8\u05da \u05d1\u05e8\u05d2\u05e2 \u05e0\u05ea\u05d5\u05df. \u05e0\u05e7\u05e8\u05d0 \u05dc\u05d5 Memento. \u05e2\u05dc \u05e9\u05de\u05d5 \u05e0\u05e7\u05e8\u05d0\u05ea \u05d4\u05ea\u05d1\u05e0\u05d9\u05ea \u05d4\u05d6\u05d5 \u05db\u05d9 \u05d4\u05d5\u05d0 \u05de\u05ea\u05d0\u05e8 \u05d0\u05ea \u05d4\u05e8\u05d2\u05e2 \u05d4\u05e0\u05ea\u05d5\u05df \u05d4\u05e1\u05e4\u05e6\u05d9\u05e4\u05d9.&nbsp; \u05de\u05d4 \u05e9\u05e0\u05e6\u05d8\u05e8\u05da \u05dc\u05d4\u05d7\u05d6\u05d9\u05e7 \u05db\u05e8\u05d2\u05e2 \u05d4\u05d5\u05d0 \u05e8\u05e7 \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05d4\u05e7\u05dc\u05d0\u05e1 \u05d4\u05d7\u05d3\u05e9 \u05e9\u05dc\u05e0\u05d5.&nbsp; \u05d6\u05d4\u05d5 \u05e4\u05d9\u05ea\u05e8\u05d5\u05df \u05d8\u05d5\u05d1 \u05d9\u05d5\u05ea\u05e8 \u05d1\u05d2\u05dc\u05dc &nbsp; \u05e9\u05d4\u05d5\u05d0 \u05de\u05d0\u05e4\u05e9\u05e8 \u05dc\u05e0\u05d5 \u05dc\u05dc\u05db\u05ea \u05d0\u05d7\u05d5\u05e8\u05d4 \u05d4\u05e8\u05d1\u05d4 \u05e4\u05e2\u05de\u05d9\u05dd &nbsp; \u05d5\u05d1\u05d2\u05dc\u05dc \u05e9\u05d0\u05e0\u05d7\u05e0\u05d5 \u05dc\u05d0 \u05de\u05e4\u05d5\u05e6\u05e6\u05d9\u05dd \u05d0\u05ea \u05d4\u05e2\u05d5\u05e8\u05da \u05d1\u05d9\u05d5\u05ea\u05e8 \u05de\u05d3\u05d9 \u05e9\u05d3\u05d5\u05ea.&nbsp; \u05d0\u05d1\u05dc \u05e2\u05d3\u05d9\u05d9\u05df \u05d9\u05e9 \u05dc\u05e0\u05d5 \u05d1\u05e2\u05d9\u05d9\u05d4. \u05d4\u05e4\u05d9\u05ea\u05e8\u05d5\u05df \u05d4\u05d6\u05d4 \u05de\u05e4\u05e8 \u05d0\u05ea \u05d4\u05e2\u05e7\u05e8\u05d5\u05df \u05d4\u05e0\u05e7\u05e8\u05d0 SRP &#8211; .&nbsp; Single Responsibility Principle&nbsp; \u05d4\u05e2\u05e7\u05e8\u05d5\u05df \u05d4\u05d6\u05d4 \u05d0\u05d5\u05de\u05e8 \u05e9\u05dc\u05db\u05dc \u05e7\u05dc\u05d0\u05e1 \u05e6\u05e8\u05d9\u05db\u05d4 \u05dc\u05d4\u05d9\u05d5\u05ea \u05e8\u05e7 \u05d0\u05d7\u05e8\u05d9\u05d5\u05ea \u05d0\u05d7\u05ea. \u05d5\u05d4\u05e7\u05dc\u05d0\u05e1 \u05e9\u05dc\u05e0\u05d5 \u05d4\u05d5\u05d0 \u05d2\u05dd \u05e2\u05d5\u05e8\u05da, \u05d0\u05da \u05d4\u05d5\u05d0 \u05d2\u05dd \u05e9\u05d5\u05de\u05e8 \u05e2\u05dc \u05d4\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4. &nbsp; \u05d0\u05dd \u05db\u05da &#8211; \u05e0\u05e8\u05e6\u05d4 \u05dc\u05e9\u05de\u05d5\u05e8 \u05d0\u05ea \u05d4\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4 \u05d1\u05e7\u05dc\u05d0\u05e1 \u05e0\u05e4\u05e8\u05d3.&nbsp; \u05e0\u05d9\u05e6\u05d5\u05e8 \u05e7\u05dc\u05d0\u05e1 \u05d7\u05d3\u05e9 \u05d1\u05e9\u05dd CareTaker, \u05d5\u05dc\u05e7\u05dc\u05d0\u05e1 \u05d6\u05d4 \u05ea\u05d4\u05d9\u05d4 \u05e8\u05e7 \u05d0\u05d7\u05e8\u05d9\u05d5\u05ea \u05d0\u05d7\u05ea &#8211; \u05e9\u05de\u05d9\u05e8\u05ea \u05d4\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4 .&nbsp; \u05d4\u05e7\u05dc\u05d0\u05e1 \u05d4\u05d6\u05d4 \u05d9\u05db\u05d9\u05dc \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc Memento.&nbsp; \u05db\u05de\u05d5 \u05db\u05df \u05e0\u05e6\u05d8\u05e8\u05da \u05e9\u05ea\u05d9 \u05de\u05ea\u05d5\u05d3\u05d5\u05ea \u05e9\u05dc \u05d4\u05db\u05e0\u05e1\u05d4 \u05dc\u05e8\u05e9\u05d9\u05de\u05d4 \u05d5\u05d4\u05d5\u05e6\u05d0\u05d4 \u05de\u05de\u05e0\u05d4.&nbsp; \u05e2\u05db\u05e9\u05d9\u05d5 \u05d4\u05e2\u05d5\u05e8\u05da \u05d4\u05e8\u05d0\u05e9\u05d9 \u05e9\u05dc\u05e0\u05d5 \u05d9\u05e6\u05d8\u05e8\u05da \u05e9\u05ea\u05d9 \u05de\u05ea\u05d5\u05d3\u05d5\u05ea \u05d7\u05d3\u05e9\u05d5\u05ea &#8211; CreateState \u05d5 RestoreState.&nbsp; \u05d4\u05d9\u05d7\u05e1\u05d9\u05dd \u05d1\u05d9\u05df \u05db\u05dc \u05d4\u05de\u05d7\u05dc\u05e7\u05d5\u05ea \u05d9\u05e8\u05d0\u05d4 \u05db\u05da:&nbsp; \u05d4\u05de\u05d9\u05de\u05d5\u05e9 \u05d1\u05e7\u05d5\u05d3 \u05d9\u05d4\u05d9\u05d4 \u05db\u05da:&nbsp; \u05ea\u05d4\u05d9\u05d4 \u05dc\u05e0\u05d5 \u05de\u05d7\u05dc\u05e7\u05d4 \u05de\u05e7\u05d5\u05e8\u05d9\u05ea \u05e9\u05dc \u05d4\u05e2\u05d5\u05e8\u05da: \u05db\u05de\u05d5\u05d1\u05df, \u05ea\u05d4\u05d9\u05d4 \u05dc\u05e0\u05d5 \u05de\u05d7\u05dc\u05e7\u05ea \u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4 \u05d4\u05e0\u05e7\u05e8\u05d0\u05ea Memento: \u05d5\u05ea\u05d4\u05d9\u05d4 \u05dc\u05e0\u05d5 \u05de\u05d7\u05dc\u05e7\u05ea \u05e2\u05d6\u05e8 \u05dc\u05e0\u05d9\u05d4\u05d5\u05dc \u05d4List. \u05e0\u05d5\u05db\u05dc \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d1\u05e7\u05d5\u05d3 \u05d1\u05d0\u05d5\u05e4\u05df \u05d4\u05d1\u05d0:\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hernan-yehuda.net\/?p=155\" \/>\n<meta property=\"og:site_name\" content=\"Design for Living\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-08T13:45:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-08T13:48:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1.png\" \/>\n<meta name=\"author\" content=\"Hernan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u05e0\u05db\u05ea\u05d1 \u05e2\u05dc \u05d9\u05d3\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hernan\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u05d6\u05de\u05df \u05e7\u05e8\u05d9\u05d0\u05d4 \u05de\u05d5\u05e2\u05e8\u05da\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u05d3\u05e7\u05d5\u05ea\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/hernan-yehuda.net\/?p=155#article\",\"isPartOf\":{\"@id\":\"https:\/\/hernan-yehuda.net\/?p=155\"},\"author\":{\"name\":\"Hernan\",\"@id\":\"https:\/\/hernan-yehuda.net\/#\/schema\/person\/0f06727fd57f92683c3ad425a9ecaf64\"},\"headline\":\"Memento\",\"datePublished\":\"2021-07-08T13:45:47+00:00\",\"dateModified\":\"2021-07-08T13:48:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/hernan-yehuda.net\/?p=155\"},\"wordCount\":63,\"publisher\":{\"@id\":\"https:\/\/hernan-yehuda.net\/#\/schema\/person\/0f06727fd57f92683c3ad425a9ecaf64\"},\"image\":{\"@id\":\"https:\/\/hernan-yehuda.net\/?p=155#primaryimage\"},\"thumbnailUrl\":\"https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1.png\",\"keywords\":[\"Design Patterns\",\"memento\",\"SOLID\"],\"articleSection\":[\"Design Patterns\",\"SOLID\"],\"inLanguage\":\"he-IL\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hernan-yehuda.net\/?p=155\",\"url\":\"https:\/\/hernan-yehuda.net\/?p=155\",\"name\":\"Memento - Design for Living\",\"isPartOf\":{\"@id\":\"https:\/\/hernan-yehuda.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/hernan-yehuda.net\/?p=155#primaryimage\"},\"image\":{\"@id\":\"https:\/\/hernan-yehuda.net\/?p=155#primaryimage\"},\"thumbnailUrl\":\"https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1.png\",\"datePublished\":\"2021-07-08T13:45:47+00:00\",\"dateModified\":\"2021-07-08T13:48:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/hernan-yehuda.net\/?p=155#breadcrumb\"},\"inLanguage\":\"he-IL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hernan-yehuda.net\/?p=155\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"he-IL\",\"@id\":\"https:\/\/hernan-yehuda.net\/?p=155#primaryimage\",\"url\":\"https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1.png\",\"contentUrl\":\"https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1.png\",\"width\":355,\"height\":402},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hernan-yehuda.net\/?p=155#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u05d3\u05e3 \u05d4\u05d1\u05d9\u05ea\",\"item\":\"https:\/\/hernan-yehuda.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Memento\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hernan-yehuda.net\/#website\",\"url\":\"https:\/\/hernan-yehuda.net\/\",\"name\":\"\u05d0\u05e8\u05e0\u05df \u05de\u05d9\u05d9\u05e1\u05dc\u05e1\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/hernan-yehuda.net\/#\/schema\/person\/0f06727fd57f92683c3ad425a9ecaf64\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/hernan-yehuda.net\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"he-IL\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/hernan-yehuda.net\/#\/schema\/person\/0f06727fd57f92683c3ad425a9ecaf64\",\"name\":\"Hernan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"he-IL\",\"@id\":\"https:\/\/hernan-yehuda.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fccf8cf4fc450b691c936a8d8435a7531aebd25301f198fe852050983a235aef?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fccf8cf4fc450b691c936a8d8435a7531aebd25301f198fe852050983a235aef?s=96&d=mm&r=g\",\"caption\":\"Hernan\"},\"logo\":{\"@id\":\"https:\/\/hernan-yehuda.net\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/hernan-yehuda.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Memento - Design for Living","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hernan-yehuda.net\/?p=155","og_locale":"he_IL","og_type":"article","og_title":"Memento - Design for Living","og_description":"\u05de\u05de\u05e0\u05d8\u05d5 \u05d4\u05d9\u05d0 \u05ea\u05d1\u05e0\u05d9\u05ea \u05e2\u05d9\u05e6\u05d5\u05d1 \u05dc\u05de\u05d9\u05de\u05d5\u05e9 \u05de\u05e0\u05d2\u05e0\u05d5\u05df \u05e9\u05d9\u05d7\u05d6\u05d5\u05e8 \u2013 \u05db\u05dc\u05d5\u05de\u05e8 \u05dc\u05e2\u05e9\u05d5\u05ea undo \u05d0\u05d5 ctrl +z \u05dc\u05e4\u05e2\u05d5\u05dc\u05d4 \u05e9\u05e2\u05e9\u05d9\u05e0\u05d5.&nbsp; \u05dc\u05e4\u05e2\u05de\u05d9\u05dd \u05d4\u05ea\u05d1\u05e0\u05d9\u05ea \u05d4\u05d6\u05d5 \u05e0\u05e7\u05e8\u05d0\u05ea snapshot \u05d1\u05d2\u05dc\u05dc \u05e9\u05d4\u05d9\u05d0 \u05e9\u05d5\u05de\u05e8\u05ea &#8216;\u05ea\u05de\u05d5\u05e0\u05ea-\u05de\u05e6\u05d1&#8217; \u05e7\u05d5\u05d3\u05de\u05ea \u05d5\u05de\u05d0\u05e4\u05e9\u05e8\u05ea \u05dc\u05d7\u05d6\u05d5\u05e8 \u05d0\u05dc\u05d9\u05d4.&nbsp; \u05d4\u05d3\u05e8\u05da \u05d4\u05e0\u05d5\u05d7\u05d4 \u05d5\u05d4\u05de\u05e7\u05d5\u05d1\u05dc\u05ea \u05dc\u05d4\u05e1\u05d1\u05d9\u05e8 \u05ea\u05d1\u05e0\u05d9\u05ea \u05d6\u05d5 \u05d4\u05d9\u05d0 \u05e2\u05dc \u05d9\u05d3\u05d9 \u05d3\u05d5\u05d2\u05de\u05d0 \u05e9\u05dc \u05e2\u05d5\u05e8\u05da \u05d8\u05e7\u05e1\u05d8. &nbsp; &nbsp;\u05e0\u05e0\u05d9\u05d7 \u05e9\u05d9\u05e9 \u05dc\u05d9 \u05e2\u05d5\u05e8\u05da \u05d8\u05e7\u05e1\u05d8 \u05d4\u05de\u05de\u05d5\u05de\u05e9 \u05d1\u05e7\u05dc\u05d0\u05e1 \u05d1\u05e9\u05dd Editor \u05d0\u05d5 \u05db\u05e4\u05d9 \u05e9\u05d4\u05d5\u05d0 \u05e0\u05e7\u05e8\u05d0 \u05d1\u05de\u05e7\u05d5\u05e8 &#8211; Originator . \u05d0\u05db\u05e0\u05d9\u05e1 \u05dc\u05ea\u05d5\u05db\u05d5 \u05e2\u05e8\u05db\u05d9\u05dd \u05d1\u05d0\u05d5\u05e4\u05df \u05d4\u05d1\u05d0:&nbsp; \u05d5\u05d0\u05e0\u05d9 \u05de\u05e6\u05e4\u05d4 \u05e9\u05ea\u05d4\u05d9\u05d4 \u05dc\u05d9 \u05d0\u05e4\u05e9\u05e8\u05d5\u05ea \u05dc\u05d1\u05d8\u05dc \u05d0\u05ea \u05d4\u05e4\u05e2\u05d5\u05dc\u05d4 \/ \u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d4\u05d0\u05d7\u05e8\u05d5\u05e0\u05d5\u05ea. \u05dc\u05de\u05e9\u05dc \u05e9\u05ea\u05d4\u05d9\u05d4 \u05dc\u05d9 \u05de\u05ea\u05d5\u05d3\u05d4 \u05db\u05d6\u05d5:&nbsp; \u05d0\u05d9\u05da \u05d4\u05d9\u05d9\u05ea\u05dd \u05de\u05de\u05de\u05e9\u05d9\u05dd \u05de\u05e0\u05d2\u05e0\u05d5\u05df \u05db\u05d6\u05d4?&nbsp; \u05d0\u05dd \u05dc\u05de\u05e9\u05dc \u05d4\u05d9\u05d9\u05ea\u05d9 \u05de\u05d5\u05e1\u05d9\u05e3 \u05dc\u05e2\u05d5\u05e8\u05da \u05e9\u05dc\u05d9 \u05e9\u05d3\u05d4 \u05e0\u05d5\u05e1\u05e3 \u05de\u05e1\u05d5\u05d2 STRING \u05d1\u05e9\u05dd prevContent \u05d5\u05d1\u05db\u05dc \u05e4\u05e2\u05dd \u05e9\u05d0\u05e0\u05d9 \u05e8\u05d5\u05e6\u05d4 \u05dc\u05e9\u05e0\u05d5\u05ea \u05d0\u05ea \u05d4\u05e2\u05e8\u05da \u05e9\u05dc CONTENT \u05d4\u05d9\u05d9\u05ea\u05d9 \u05e9\u05d5\u05de\u05e8 \u05dc\u05e4\u05e0\u05d9 \u05d6\u05d4 \u05d0\u05ea \u05d4\u05e2\u05e8\u05da \u05d4\u05e0\u05d5\u05db\u05d7\u05d9 \u05d1\u05e9\u05d3\u05d4 \u05d4\u05d7\u05d3\u05e9, \u05d0\u05d6 \u05d4\u05d9\u05d9\u05ea\u05d9 \u05d9\u05db\u05d5\u05dc \u05dc\u05e2\u05e9\u05d5\u05ea UNDO \u05e8\u05e7 \u05e4\u05e2\u05dd \u05d0\u05d7\u05ea, \u05e8\u05e7 \u05e2\u05dc \u05d4\u05e9\u05d9\u05e0\u05d5\u05d9 \u05d4\u05d0\u05d7\u05e8\u05d5\u05df.&nbsp; \u05dc\u05db\u05df \u05d0\u05e0\u05d9 \u05e6\u05e8\u05d9\u05da \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05e2\u05e8\u05db\u05d9\u05dd \u05e7\u05d5\u05d3\u05de\u05d9\u05dd.&nbsp; \u05d0\u05d1\u05dc \u05d4\u05d4\u05d2\u05d9\u05d5\u05df \u05d0\u05d5\u05de\u05e8 \u05e9\u05d0\u05e0\u05d9 \u05dc\u05d0 \u05e8\u05d5\u05e6\u05d4 \u05e8\u05e7&nbsp; \u05d4\u05ea\u05d5\u05db\u05df, \u05d0\u05dc\u05d0 \u05d2\u05dd \u05d0\u05ea \u05d4\u05db\u05d5\u05ea\u05e8\u05ea, \u05d0\u05ea \u05e6\u05d1\u05e2 \u05d4\u05e8\u05e7\u05e2 \u05d5\u05db\u05d5&#8217; \u05d5\u05db\u05d5&#8217; &#8211; \u05db\u05e4\u05d9 \u05e9\u05d0\u05e0\u05d7\u05e0\u05d5 \u05e8\u05d2\u05d9\u05dc\u05d9\u05dd \u05d1\u05db\u05dc \u05ea\u05d5\u05db\u05e0\u05d4 \u05de\u05e6\u05d5\u05d9\u05d4 \u05d1\u05e9\u05d5\u05e7.&nbsp; \u05d0\u05d6 \u05de\u05d4 \u05e9\u05d9\u05e6\u05d0 \u05d6\u05d4 \u05e9\u05d0\u05e6\u05d8\u05e8\u05da \u05e2\u05dc \u05db\u05dc \u05d0\u05d7\u05d3 \u05de\u05d4\u05d0\u05d9\u05d1\u05e8\u05d9\u05dd \u05e9\u05dc \u05d4\u05e2\u05d5\u05e8\u05da \u05e9\u05dc\u05d9 \u05d2\u05dd \u05e9\u05d3\u05d4 \u05d1\u05e7\u05dc\u05d0\u05e1 \u05d5\u05d2\u05dd \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05db\u05dc \u05d4\u05de\u05e6\u05d1\u05d9\u05dd \u05d4\u05e7\u05d5\u05d3\u05de\u05d9\u05dd \u05e9\u05dc \u05d0\u05d5\u05ea\u05d5 \u05d4\u05e9\u05d3\u05d4. &nbsp; \u05db\u05dc\u05d5\u05de\u05e8 &#8211; \u05d4\u05e8\u05d1\u05d4 \u05e9\u05d3\u05d5\u05ea \u05d5\u05db\u05e0\u05d2\u05d3\u05dd \u05d4\u05e8\u05d1\u05d4 \u05e8\u05e9\u05d9\u05de\u05d5\u05ea. \u05e7\u05e6\u05ea \u05d1\u05dc\u05d0\u05d2\u05df.&nbsp; \u05d0\u05d6 \u05d0\u05d9\u05da \u05e0\u05e4\u05ea\u05d5\u05e8 \u05d0\u05ea \u05d6\u05d4?&nbsp; \u05e0\u05d9\u05e6\u05d5\u05e8 \u05e7\u05dc\u05d0\u05e1 \u05d7\u05d3\u05e9 \u05e9\u05de\u05d2\u05dc\u05dd \u05d0\u05ea \u05d4\u05de\u05e6\u05d1 \u05e9\u05dc \u05d4\u05e2\u05d5\u05e8\u05da \u05d1\u05e8\u05d2\u05e2 \u05e0\u05ea\u05d5\u05df. \u05e0\u05e7\u05e8\u05d0 \u05dc\u05d5 Memento. \u05e2\u05dc \u05e9\u05de\u05d5 \u05e0\u05e7\u05e8\u05d0\u05ea \u05d4\u05ea\u05d1\u05e0\u05d9\u05ea \u05d4\u05d6\u05d5 \u05db\u05d9 \u05d4\u05d5\u05d0 \u05de\u05ea\u05d0\u05e8 \u05d0\u05ea \u05d4\u05e8\u05d2\u05e2 \u05d4\u05e0\u05ea\u05d5\u05df \u05d4\u05e1\u05e4\u05e6\u05d9\u05e4\u05d9.&nbsp; \u05de\u05d4 \u05e9\u05e0\u05e6\u05d8\u05e8\u05da \u05dc\u05d4\u05d7\u05d6\u05d9\u05e7 \u05db\u05e8\u05d2\u05e2 \u05d4\u05d5\u05d0 \u05e8\u05e7 \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc \u05d4\u05e7\u05dc\u05d0\u05e1 \u05d4\u05d7\u05d3\u05e9 \u05e9\u05dc\u05e0\u05d5.&nbsp; \u05d6\u05d4\u05d5 \u05e4\u05d9\u05ea\u05e8\u05d5\u05df \u05d8\u05d5\u05d1 \u05d9\u05d5\u05ea\u05e8 \u05d1\u05d2\u05dc\u05dc &nbsp; \u05e9\u05d4\u05d5\u05d0 \u05de\u05d0\u05e4\u05e9\u05e8 \u05dc\u05e0\u05d5 \u05dc\u05dc\u05db\u05ea \u05d0\u05d7\u05d5\u05e8\u05d4 \u05d4\u05e8\u05d1\u05d4 \u05e4\u05e2\u05de\u05d9\u05dd &nbsp; \u05d5\u05d1\u05d2\u05dc\u05dc \u05e9\u05d0\u05e0\u05d7\u05e0\u05d5 \u05dc\u05d0 \u05de\u05e4\u05d5\u05e6\u05e6\u05d9\u05dd \u05d0\u05ea \u05d4\u05e2\u05d5\u05e8\u05da \u05d1\u05d9\u05d5\u05ea\u05e8 \u05de\u05d3\u05d9 \u05e9\u05d3\u05d5\u05ea.&nbsp; \u05d0\u05d1\u05dc \u05e2\u05d3\u05d9\u05d9\u05df \u05d9\u05e9 \u05dc\u05e0\u05d5 \u05d1\u05e2\u05d9\u05d9\u05d4. \u05d4\u05e4\u05d9\u05ea\u05e8\u05d5\u05df \u05d4\u05d6\u05d4 \u05de\u05e4\u05e8 \u05d0\u05ea \u05d4\u05e2\u05e7\u05e8\u05d5\u05df \u05d4\u05e0\u05e7\u05e8\u05d0 SRP &#8211; .&nbsp; Single Responsibility Principle&nbsp; \u05d4\u05e2\u05e7\u05e8\u05d5\u05df \u05d4\u05d6\u05d4 \u05d0\u05d5\u05de\u05e8 \u05e9\u05dc\u05db\u05dc \u05e7\u05dc\u05d0\u05e1 \u05e6\u05e8\u05d9\u05db\u05d4 \u05dc\u05d4\u05d9\u05d5\u05ea \u05e8\u05e7 \u05d0\u05d7\u05e8\u05d9\u05d5\u05ea \u05d0\u05d7\u05ea. \u05d5\u05d4\u05e7\u05dc\u05d0\u05e1 \u05e9\u05dc\u05e0\u05d5 \u05d4\u05d5\u05d0 \u05d2\u05dd \u05e2\u05d5\u05e8\u05da, \u05d0\u05da \u05d4\u05d5\u05d0 \u05d2\u05dd \u05e9\u05d5\u05de\u05e8 \u05e2\u05dc \u05d4\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4. &nbsp; \u05d0\u05dd \u05db\u05da &#8211; \u05e0\u05e8\u05e6\u05d4 \u05dc\u05e9\u05de\u05d5\u05e8 \u05d0\u05ea \u05d4\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4 \u05d1\u05e7\u05dc\u05d0\u05e1 \u05e0\u05e4\u05e8\u05d3.&nbsp; \u05e0\u05d9\u05e6\u05d5\u05e8 \u05e7\u05dc\u05d0\u05e1 \u05d7\u05d3\u05e9 \u05d1\u05e9\u05dd CareTaker, \u05d5\u05dc\u05e7\u05dc\u05d0\u05e1 \u05d6\u05d4 \u05ea\u05d4\u05d9\u05d4 \u05e8\u05e7 \u05d0\u05d7\u05e8\u05d9\u05d5\u05ea \u05d0\u05d7\u05ea &#8211; \u05e9\u05de\u05d9\u05e8\u05ea \u05d4\u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4 .&nbsp; \u05d4\u05e7\u05dc\u05d0\u05e1 \u05d4\u05d6\u05d4 \u05d9\u05db\u05d9\u05dc \u05e8\u05e9\u05d9\u05de\u05d4 \u05e9\u05dc Memento.&nbsp; \u05db\u05de\u05d5 \u05db\u05df \u05e0\u05e6\u05d8\u05e8\u05da \u05e9\u05ea\u05d9 \u05de\u05ea\u05d5\u05d3\u05d5\u05ea \u05e9\u05dc \u05d4\u05db\u05e0\u05e1\u05d4 \u05dc\u05e8\u05e9\u05d9\u05de\u05d4 \u05d5\u05d4\u05d5\u05e6\u05d0\u05d4 \u05de\u05de\u05e0\u05d4.&nbsp; \u05e2\u05db\u05e9\u05d9\u05d5 \u05d4\u05e2\u05d5\u05e8\u05da \u05d4\u05e8\u05d0\u05e9\u05d9 \u05e9\u05dc\u05e0\u05d5 \u05d9\u05e6\u05d8\u05e8\u05da \u05e9\u05ea\u05d9 \u05de\u05ea\u05d5\u05d3\u05d5\u05ea \u05d7\u05d3\u05e9\u05d5\u05ea &#8211; CreateState \u05d5 RestoreState.&nbsp; \u05d4\u05d9\u05d7\u05e1\u05d9\u05dd \u05d1\u05d9\u05df \u05db\u05dc \u05d4\u05de\u05d7\u05dc\u05e7\u05d5\u05ea \u05d9\u05e8\u05d0\u05d4 \u05db\u05da:&nbsp; \u05d4\u05de\u05d9\u05de\u05d5\u05e9 \u05d1\u05e7\u05d5\u05d3 \u05d9\u05d4\u05d9\u05d4 \u05db\u05da:&nbsp; \u05ea\u05d4\u05d9\u05d4 \u05dc\u05e0\u05d5 \u05de\u05d7\u05dc\u05e7\u05d4 \u05de\u05e7\u05d5\u05e8\u05d9\u05ea \u05e9\u05dc \u05d4\u05e2\u05d5\u05e8\u05da: \u05db\u05de\u05d5\u05d1\u05df, \u05ea\u05d4\u05d9\u05d4 \u05dc\u05e0\u05d5 \u05de\u05d7\u05dc\u05e7\u05ea \u05d4\u05d9\u05e1\u05d8\u05d5\u05e8\u05d9\u05d4 \u05d4\u05e0\u05e7\u05e8\u05d0\u05ea Memento: \u05d5\u05ea\u05d4\u05d9\u05d4 \u05dc\u05e0\u05d5 \u05de\u05d7\u05dc\u05e7\u05ea \u05e2\u05d6\u05e8 \u05dc\u05e0\u05d9\u05d4\u05d5\u05dc \u05d4List. \u05e0\u05d5\u05db\u05dc \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d1\u05e7\u05d5\u05d3 \u05d1\u05d0\u05d5\u05e4\u05df \u05d4\u05d1\u05d0:","og_url":"https:\/\/hernan-yehuda.net\/?p=155","og_site_name":"Design for Living","article_published_time":"2021-07-08T13:45:47+00:00","article_modified_time":"2021-07-08T13:48:59+00:00","og_image":[{"url":"https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1.png","type":"","width":"","height":""}],"author":"Hernan","twitter_card":"summary_large_image","twitter_misc":{"\u05e0\u05db\u05ea\u05d1 \u05e2\u05dc \u05d9\u05d3":"Hernan","\u05d6\u05de\u05df \u05e7\u05e8\u05d9\u05d0\u05d4 \u05de\u05d5\u05e2\u05e8\u05da":"3 \u05d3\u05e7\u05d5\u05ea"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hernan-yehuda.net\/?p=155#article","isPartOf":{"@id":"https:\/\/hernan-yehuda.net\/?p=155"},"author":{"name":"Hernan","@id":"https:\/\/hernan-yehuda.net\/#\/schema\/person\/0f06727fd57f92683c3ad425a9ecaf64"},"headline":"Memento","datePublished":"2021-07-08T13:45:47+00:00","dateModified":"2021-07-08T13:48:59+00:00","mainEntityOfPage":{"@id":"https:\/\/hernan-yehuda.net\/?p=155"},"wordCount":63,"publisher":{"@id":"https:\/\/hernan-yehuda.net\/#\/schema\/person\/0f06727fd57f92683c3ad425a9ecaf64"},"image":{"@id":"https:\/\/hernan-yehuda.net\/?p=155#primaryimage"},"thumbnailUrl":"https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1.png","keywords":["Design Patterns","memento","SOLID"],"articleSection":["Design Patterns","SOLID"],"inLanguage":"he-IL"},{"@type":"WebPage","@id":"https:\/\/hernan-yehuda.net\/?p=155","url":"https:\/\/hernan-yehuda.net\/?p=155","name":"Memento - Design for Living","isPartOf":{"@id":"https:\/\/hernan-yehuda.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hernan-yehuda.net\/?p=155#primaryimage"},"image":{"@id":"https:\/\/hernan-yehuda.net\/?p=155#primaryimage"},"thumbnailUrl":"https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1.png","datePublished":"2021-07-08T13:45:47+00:00","dateModified":"2021-07-08T13:48:59+00:00","breadcrumb":{"@id":"https:\/\/hernan-yehuda.net\/?p=155#breadcrumb"},"inLanguage":"he-IL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hernan-yehuda.net\/?p=155"]}]},{"@type":"ImageObject","inLanguage":"he-IL","@id":"https:\/\/hernan-yehuda.net\/?p=155#primaryimage","url":"https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1.png","contentUrl":"https:\/\/hernan-yehuda.net\/wp-content\/uploads\/2021\/07\/ClassDiagram1.png","width":355,"height":402},{"@type":"BreadcrumbList","@id":"https:\/\/hernan-yehuda.net\/?p=155#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u05d3\u05e3 \u05d4\u05d1\u05d9\u05ea","item":"https:\/\/hernan-yehuda.net\/"},{"@type":"ListItem","position":2,"name":"Memento"}]},{"@type":"WebSite","@id":"https:\/\/hernan-yehuda.net\/#website","url":"https:\/\/hernan-yehuda.net\/","name":"\u05d0\u05e8\u05e0\u05df \u05de\u05d9\u05d9\u05e1\u05dc\u05e1","description":"","publisher":{"@id":"https:\/\/hernan-yehuda.net\/#\/schema\/person\/0f06727fd57f92683c3ad425a9ecaf64"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hernan-yehuda.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"he-IL"},{"@type":["Person","Organization"],"@id":"https:\/\/hernan-yehuda.net\/#\/schema\/person\/0f06727fd57f92683c3ad425a9ecaf64","name":"Hernan","image":{"@type":"ImageObject","inLanguage":"he-IL","@id":"https:\/\/hernan-yehuda.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fccf8cf4fc450b691c936a8d8435a7531aebd25301f198fe852050983a235aef?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fccf8cf4fc450b691c936a8d8435a7531aebd25301f198fe852050983a235aef?s=96&d=mm&r=g","caption":"Hernan"},"logo":{"@id":"https:\/\/hernan-yehuda.net\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/hernan-yehuda.net"]}]}},"_links":{"self":[{"href":"https:\/\/hernan-yehuda.net\/index.php?rest_route=\/wp\/v2\/posts\/155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hernan-yehuda.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hernan-yehuda.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hernan-yehuda.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hernan-yehuda.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=155"}],"version-history":[{"count":3,"href":"https:\/\/hernan-yehuda.net\/index.php?rest_route=\/wp\/v2\/posts\/155\/revisions"}],"predecessor-version":[{"id":159,"href":"https:\/\/hernan-yehuda.net\/index.php?rest_route=\/wp\/v2\/posts\/155\/revisions\/159"}],"wp:attachment":[{"href":"https:\/\/hernan-yehuda.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hernan-yehuda.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hernan-yehuda.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}