Serge Aurubin

SERGE AURUBIN

SR. AI CLOUD ENGINEER

Welcome to my blog for everything having to do with data science and analysis. I am always looking for new opportunities to drive business insight using data analysis.

Data & Analytics
  • Data Analysis
  • Power BI
  • Excel
  • Data Pipelines
  • Matillion
Engineering
  • Software Developer
  • Python
  • PHP
  • ReactJS
  • Flutter
  • Front End Dev
  • Back End Dev
Databases
  • MySQL Dev/DBA
  • Oracle DBA
Cloud & AI
  • Amazon Web Services
  • Docker
  • Kubernetes
  • Git
  • Artificial Intelligence
  • Claude
  • OpenAI
Back to Videos

The Memento Pattern: Saving State Without Breaking Encapsulation

ArjanCodes

October 9, 2026   37

????????‍???? 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 sounds simple until every change needs its own reverse logic. The Memento pattern offers a different approach: save an object's state and restore it when you need to go back. In this video, I show how to implement the Memento pattern in modern Python using snapshots, dataclasses, protocols, and generics.

???? GitHub Repository: https://git.arjan.codes/2026/memento.

???? Join my Discord server: https://discord.arjan.codes.

⌨️ Keyboard I’m using: https://amzn.to/49YM97v.

???? Chapters:
0:00 Intro
1:20 The Workflow
2:40 Take a Snapshot
6:08 Originator, Memento, and Caretaker
11:02 What Should Be in the Snapshot?
12:03 Undo and Redo
13:12 Memento vs Command
14:01 Beyond Undo
14:35 When Not to Use It
15:07 Final Thoughts

#arjancodes #softwaredesign #python

0 Comments

No comments yet. Be the first to weigh in.

Back to Videos

Login