{"slug":"memento","group":"behavioral","title":"Pamiątka","short":"Zapisuje i przywraca stan obiektu bez naruszania jego hermetyzacji.","icon":"save","aliases":[],"order":305,"status":"available","articleCount":2,"groupTitle":"Wzorce behawioralne","intro":"","servedLang":"pl","primaryArticle":{"id":"6b08bd3a80884893657cc9b4","slug":"memento","title":"Pamiątka (Memento): migawka stanu bez łamania hermetyzacji","summary":"Wzorzec Pamiątka na przykładzie edytora karty dań: Halina zapisuje wersje menu i wraca do nich jednym kliknięciem, a historia przechowuje migawki, nie widząc ich zawartości. Kopie zamiast referencji, koszty pamięci i kod w pięciu językach.","servedLang":"pl","availableLangs":["pl","en"],"topics":["memento"],"techs":["dotnet","typescript","java","go","python"],"tags":["gof","behavioral","memento","undo","snapshots","encapsulation"],"level":"intermediate","kind":"article","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":12,"stats":{"views":2,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:14:02.576Z","updatedAt":"2026-11-27T13:10:08.081Z","challengeCount":2,"quizCount":0},"articles":[{"id":"6b08bd3c80884893657cc9f1","slug":"prototype","title":"Prototyp (Prototype) – nowy obiekt jako kopia gotowego wzorca","summary":"Prototyp tworzy obiekty przez klonowanie skonfigurowanego egzemplarza zamiast budowania ich od zera. Wyjaśniamy różnicę między kopią płytką a głęboką na przykładzie szablonów egzaminów.","servedLang":"pl","availableLangs":["pl","en"],"topics":["prototype","abstract-factory","memento"],"techs":["dotnet","typescript","java","go","python"],"tags":["gof","creational","prototype","cloning","deep-copy"],"level":"intermediate","kind":"article","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":9,"stats":{"views":3,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:14:04.737Z","updatedAt":"2026-11-27T13:04:32.155Z","relation":{"position":2,"primary":false,"mainTopic":{"slug":"prototype","title":"Prototyp"}}}],"challenges":[{"id":"6b093dc191bd8fbaf2a0c8c8","slug":"game-checkpoint-memento","title":"Punkty kontrolne w grze","summary":"Zapis i odtwarzanie stanu bohatera przez Pamiątkę – niezmienne migawki bez współdzielonych list, opiekun z ograniczoną pojemnością i ochrona przed wczytaniem cudzego zapisu.","servedLang":"pl","availableLangs":["pl","en"],"kind":"code","category":"pattern","status":"published","difficulty":"easy","topics":["memento"],"techs":["typescript","javascript","python","dotnet","java","go"],"tags":["memento","snapshots","undo","immutability","behavioral"],"languages":["typescript","javascript","python","csharp","java","go"],"questionCount":null,"xp":10,"stats":{"attempts":0,"solves":0,"solutions":0,"comments":0},"solveRate":null,"publishedAt":"2026-11-27T08:22:25.224Z"},{"id":"6b093ddfbd4755deb67ee09b","slug":"serialize-binary-tree","title":"Serializacja drzewa binarnego","summary":"Zapisujemy drzewo binarne do napisu i odtwarzamy je z powrotem – z pustymi poddrzewami, ujemnymi liczbami i drzewami głębokimi na tysiące poziomów. Projekt formatu, BFS i pułapka rekurencji.","servedLang":"pl","availableLangs":["pl","en"],"kind":"code","category":"algorithms","status":"published","difficulty":"hard","topics":["memento"],"techs":["typescript","javascript","python","dotnet","java","go"],"tags":["trees","binary-tree","bfs","dfs","serialization","design"],"languages":["typescript","javascript","python","csharp","java","go"],"questionCount":null,"xp":40,"stats":{"attempts":0,"solves":0,"solutions":0,"comments":0},"solveRate":null,"publishedAt":"2026-11-27T08:22:55.586Z"}],"resources":[{"id":"6b0857c53c96f2d34d0b4887","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=ZXAt8AP3DnY","embedUrl":"https://www.youtube-nocookie.com/embed/ZXAt8AP3DnY","title":"The Memento Pattern: Saving State Without Breaking Encapsulation","description":"👨🏻‍💻 Join me in Utrecht next year for an in-person Software Design Retreat! Design, discuss, and learn alongside fellow developers. Join the waitlist: https://arjancodes.com/retreat. 🧱 Build software that lasts. Join the Software Design Mastery program → https://arjan.codes/mastery. Undo…","author":"ArjanCodes","thumbnailUrl":"https://i.ytimg.com/vi/ZXAt8AP3DnY/hqdefault.jpg","durationSec":null,"lang":"en","topics":["memento"],"techs":["python"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"youtube-rss","publishedAt":"2026-10-09T15:00:08.000Z","popularity":72,"verifiedAt":"2026-11-26T10:54:43.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:07.481Z","updatedAt":"2026-11-26T16:01:07.481Z"},{"id":"6b0857bf3c96f2d34d0b42d4","type":"article","provider":"web","url":"https://refactoring.guru/pl/design-patterns/memento","embedUrl":null,"title":"Pamiątka / Memento","description":"Pamiątka to behawioralny wzorzec projektowy pozwalający zapisywać i przywracać wcześniejszy stan obiektu bez ujawniania szczegółów jego implementacji.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/pl/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"pl","topics":["memento"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":60,"verifiedAt":"2026-11-26T11:26:13.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857bb3c96f2d34d0b4009","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/us/podcast/design-patterns-part-4-adapter-facade-and-memento/id769189585?i=1000378375293","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id769189585?i=1000378375293","title":"Design Patterns Part 4 – Adapter, Facade, and Memento","description":"Part 4 of our design patterns series, this time up it's Adapters, Facades, and Mementos. Oh, an which tech luminary would make the best head of state!","author":"Coding Blocks","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts113/v4/f0/b6/68/f0b6682f-e8bc-181c-95a9-0756ddf63d6e/mza_3128980961332034780.jpg/600x600bb.jpg","durationSec":4452,"lang":"en","topics":["adapter","facade","memento"],"techs":["general"],"tags":["podcast","design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2015-07-26T12:00:44.000Z","popularity":46,"verifiedAt":"2026-11-26T10:57:39.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:57.868Z","updatedAt":"2026-11-26T16:00:57.868Z"},{"id":"6b0857c33c96f2d34d0b4658","type":"book","provider":"openlibrary","url":"https://openlibrary.org/works/OL6030812W","embedUrl":null,"title":"Design Patterns: Elements of Reusable Object-Oriented Software","description":"","author":"Erich Gamma, John Vlissides, Richard Helm, Ralph Johnson","thumbnailUrl":"https://covers.openlibrary.org/b/id/6601119-L.jpg","durationSec":null,"lang":"en","topics":["factory-method","abstract-factory","builder","prototype","singleton","adapter","bridge","composite","decorator","facade","flyweight","proxy","chain-of-responsibility","command","iterator","mediator","memento","observer","state","strategy","template-method","visitor"],"techs":["general"],"tags":["book","design-patterns"],"price":"paid","featured":false,"featuredOrder":0,"packageName":null,"source":"openlibrary","publishedAt":"1995-01-01T00:00:00.000Z","popularity":71,"verifiedAt":"2026-11-26T11:00:08.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:04.995Z","updatedAt":"2026-11-26T16:01:04.995Z"},{"id":"6b0857bf3c96f2d34d0b427e","type":"article","provider":"web","url":"https://refactoring.guru/design-patterns/memento","embedUrl":null,"title":"Memento","description":"Memento is a behavioral design pattern that lets you save and restore the previous state of an object without revealing the details of its implementation.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"en","topics":["memento"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":65,"verifiedAt":"2026-11-26T11:26:05.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"}],"resourceGroups":[{"type":"video","items":[{"id":"6b0857c53c96f2d34d0b4887","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=ZXAt8AP3DnY","embedUrl":"https://www.youtube-nocookie.com/embed/ZXAt8AP3DnY","title":"The Memento Pattern: Saving State Without Breaking Encapsulation","description":"👨🏻‍💻 Join me in Utrecht next year for an in-person Software Design Retreat! Design, discuss, and learn alongside fellow developers. Join the waitlist: https://arjancodes.com/retreat. 🧱 Build software that lasts. Join the Software Design Mastery program → https://arjan.codes/mastery. Undo…","author":"ArjanCodes","thumbnailUrl":"https://i.ytimg.com/vi/ZXAt8AP3DnY/hqdefault.jpg","durationSec":null,"lang":"en","topics":["memento"],"techs":["python"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"youtube-rss","publishedAt":"2026-10-09T15:00:08.000Z","popularity":72,"verifiedAt":"2026-11-26T10:54:43.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:07.481Z","updatedAt":"2026-11-26T16:01:07.481Z"}]},{"type":"podcast","items":[{"id":"6b0857bb3c96f2d34d0b4009","type":"podcast","provider":"apple-podcasts","url":"https://podcasts.apple.com/us/podcast/design-patterns-part-4-adapter-facade-and-memento/id769189585?i=1000378375293","embedUrl":"https://embed.podcasts.apple.com/us/podcast/id769189585?i=1000378375293","title":"Design Patterns Part 4 – Adapter, Facade, and Memento","description":"Part 4 of our design patterns series, this time up it's Adapters, Facades, and Mementos. Oh, an which tech luminary would make the best head of state!","author":"Coding Blocks","thumbnailUrl":"https://is1-ssl.mzstatic.com/image/thumb/Podcasts113/v4/f0/b6/68/f0b6682f-e8bc-181c-95a9-0756ddf63d6e/mza_3128980961332034780.jpg/600x600bb.jpg","durationSec":4452,"lang":"en","topics":["adapter","facade","memento"],"techs":["general"],"tags":["podcast","design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"itunes","publishedAt":"2015-07-26T12:00:44.000Z","popularity":46,"verifiedAt":"2026-11-26T10:57:39.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:57.868Z","updatedAt":"2026-11-26T16:00:57.868Z"}]},{"type":"article","items":[{"id":"6b0857bf3c96f2d34d0b42d4","type":"article","provider":"web","url":"https://refactoring.guru/pl/design-patterns/memento","embedUrl":null,"title":"Pamiątka / Memento","description":"Pamiątka to behawioralny wzorzec projektowy pozwalający zapisywać i przywracać wcześniejszy stan obiektu bez ujawniania szczegółów jego implementacji.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/pl/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"pl","topics":["memento"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":60,"verifiedAt":"2026-11-26T11:26:13.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857bf3c96f2d34d0b427e","type":"article","provider":"web","url":"https://refactoring.guru/design-patterns/memento","embedUrl":null,"title":"Memento","description":"Memento is a behavioral design pattern that lets you save and restore the previous state of an object without revealing the details of its implementation.","author":"Refactoring.Guru","thumbnailUrl":"https://refactoring.guru/images/refactoring/social/facebook-share-preview.png?id=dbf9e98269595be86eb668f365be6868","durationSec":null,"lang":"en","topics":["memento"],"techs":["general"],"tags":["design-patterns"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":65,"verifiedAt":"2026-11-26T11:26:05.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"}]},{"type":"book","items":[{"id":"6b0857c33c96f2d34d0b4658","type":"book","provider":"openlibrary","url":"https://openlibrary.org/works/OL6030812W","embedUrl":null,"title":"Design Patterns: Elements of Reusable Object-Oriented Software","description":"","author":"Erich Gamma, John Vlissides, Richard Helm, Ralph Johnson","thumbnailUrl":"https://covers.openlibrary.org/b/id/6601119-L.jpg","durationSec":null,"lang":"en","topics":["factory-method","abstract-factory","builder","prototype","singleton","adapter","bridge","composite","decorator","facade","flyweight","proxy","chain-of-responsibility","command","iterator","mediator","memento","observer","state","strategy","template-method","visitor"],"techs":["general"],"tags":["book","design-patterns"],"price":"paid","featured":false,"featuredOrder":0,"packageName":null,"source":"openlibrary","publishedAt":"1995-01-01T00:00:00.000Z","popularity":71,"verifiedAt":"2026-11-26T11:00:08.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:04.995Z","updatedAt":"2026-11-26T16:01:04.995Z"}]}],"siblings":[{"slug":"chain-of-responsibility","title":"Łańcuch zobowiązań","icon":"link","status":"available","current":false},{"slug":"command","title":"Polecenie","icon":"terminal","status":"available","current":false},{"slug":"iterator","title":"Iterator","icon":"list-ordered","status":"available","current":false},{"slug":"mediator","title":"Mediator","icon":"messages-square","status":"available","current":false},{"slug":"memento","title":"Pamiątka","icon":"save","status":"available","current":true},{"slug":"observer","title":"Obserwator","icon":"eye","status":"available","current":false},{"slug":"state","title":"Stan","icon":"toggle-right","status":"available","current":false},{"slug":"strategy","title":"Strategia","icon":"route","status":"available","current":false},{"slug":"template-method","title":"Metoda szablonowa","icon":"layout-template","status":"available","current":false},{"slug":"visitor","title":"Odwiedzający","icon":"footprints","status":"available","current":false}]}