If you spend long enough in the programming world, you'll come across the term singleton at some point. And if you hadn't seen this term yet, well, now you have! In Python, you don't need singleton classes. Almost never. But creating one is a great exercise in understanding how Python creates objects. And discussing alternatives to a singleton class helps you explore other aspects of Python.
Service design is evolving and we're quickly moving past static screens and pages toward dynamic, contextual experiences. In my previous article, Service Design in the Era of AI Agents, I discussed this evolution in detail. After reading it, many people reached out with one specific question: what exact design patterns will we use for GenUI apps? In this article, I decided to discuss specific foundational patterns for GenUI apps.