Application of the Mediator Pattern in C Language (Including 5 Source Code Examples + Linux Kernel Case Analysis)

Application of the Mediator Pattern in C Language (Including 5 Source Code Examples + Linux Kernel Case Analysis)

Application of the Mediator Pattern in C Language (Including Linux Kernel Examples) 1. Definition and Core Value of the Mediator Pattern The Mediator Pattern is a behavioral design pattern that focuses onintroducing a mediator object to encapsulate the interaction logic between multiple objects (colleagues), allowing colleagues to interact indirectly through the mediator instead of directly … Read more

Embedded Design Patterns – Decorator Pattern in C Language

Embedded Design Patterns - Decorator Pattern in C Language

The series of articles on embedded design patterns has been updated several times. Interested readers can click onprevious articles to view: Basics of Embedded Design Patterns – Inheritance, Encapsulation, and Polymorphism in C Language Embedded Design Patterns – Simple Factory Pattern in C Language Embedded Design Patterns – Abstract Factory Pattern in C Language Embedded … Read more

The Evolution of Embedded Hardware Technology

The Evolution of Embedded Hardware Technology

The Evolution of Embedded Hardware Technology Preface In today’s rapidly changing technology landscape, although Moore’s Law has gradually lost its effectiveness, the pace of hardware technology iteration remains astonishing. When we look back at the evolution of hardware products such as computers, smartphones, and IoT devices, we can see a clear “evolutionary path”—from bulky to … Read more

The ‘Invisible’ Philosophy of C++ Design Patterns: Beyond Singleton, Where Else Do We Use Them?

The 'Invisible' Philosophy of C++ Design Patterns: Beyond Singleton, Where Else Do We Use Them?

Click the blue text to follow the author 1. The ‘Invisible’ Mystery of C++ Design Patterns Have you ever thought: apart from the ubiquitous Singleton pattern in daily C++ code, the ‘standard’ implementations of other patterns rarely appear. 1.1. Why Do We Only See Singleton? Design patterns, especially the 23 classic patterns proposed by the … Read more

Implementing the Factory Pattern in Embedded Systems: Elegantly Creating Objects with C Language

Implementing the Factory Pattern in Embedded Systems: Elegantly Creating Objects with C Language

Introduction In embedded development, have you ever written code like this: creating different objects based on various hardware configurations, resulting in code filled with complex conditional statements? // Confusing object creation logic void* create_sensor(int sensor_type) { if (sensor_type == TEMP_SENSOR) { if (hardware_version == V1) { return create_temp_sensor_v1(); } else if (hardware_version == V2) { … Read more

Application of the Visitor Pattern in C Language (Including 5 Examples + Linux Kernel Case Analysis)

Application of the Visitor Pattern in C Language (Including 5 Examples + Linux Kernel Case Analysis)

Application of the Visitor Pattern in C Language (Including Linux Kernel Examples) 1. Definition and Core Value of the Visitor Pattern The Visitor Pattern is a behavioral design pattern that focuses on separating data structures from data operations, defining a visitor interface to encapsulate operations on elements within the data structure, allowing operations to be … Read more

Application of Strategy Pattern in C Language (Including 5 Examples + Linux Kernel Case Analysis)

Application of Strategy Pattern in C Language (Including 5 Examples + Linux Kernel Case Analysis)

Application of Strategy Pattern in C Language (Including Linux Kernel Examples) 1. Definition and Core Value of Strategy Pattern The Strategy Pattern is a behavioral design pattern that focuses on defining a family of algorithms (or behaviors), encapsulating each algorithm as an independent strategy object, allowing algorithms to be dynamically replaced without affecting the client … Read more

Application of Template Method Pattern in C Language (Including 5 Examples + Linux Kernel Case Analysis)

Application of Template Method Pattern in C Language (Including 5 Examples + Linux Kernel Case Analysis)

Application of Template Method Pattern in C Language (Including Linux Kernel Examples) 1. Definition and Core Value of Template Method Pattern The Template Method Pattern is a behavioral design pattern that defines the skeleton of an algorithm (the template method) and defers some steps to subclasses (or concrete implementations). The template method fixes the overall … Read more

Sharing Interview Experiences for C++ Positions

Sharing Interview Experiences for C++ Positions

Introduction Hello everyone, I am A Gan, the founder of “Running Cpp / C++” on Knowledge Planet. Today, I would like to share with you the interview experiences related to C++ positions that our community members have organized and are continuously updating. This is the most comprehensive collection available online. Interview Experience Sharing Due to … Read more

Implementing Interfaces and Polymorphism in C Language

Core InsightAlthough C language does not support classes and virtual functions, by cleverly combining function pointers with structures, we can fully implement interface abstraction and polymorphism similar to C++. This is not only a technical skill but also the best way to deeply understand the underlying mechanisms of object-oriented programming. 1. Why Implement Polymorphism in … Read more