The Cornerstone of Embedded System Architecture

In embedded system development, as project complexity increases and cross-platform requirements grow, the bare-metal programming approach of “write whatever comes to mind” is becoming inadequate. Adopting a layered architecture is key to ensuring code maintainability, portability, and testability.Among these, the division and collaboration between the hardware abstraction layer and the driver layer is the core … Read more

C++ Design Patterns: Observer Pattern

The Observer Pattern is a behavioral design pattern that defines a one-to-many dependency between objects. When the state of one object (the Subject) changes, all dependent objects (the Observers) are notified and updated automatically. This pattern is also known as the “publish-subscribe” pattern. Core Roles of the Observer Pattern Subject: The object being observed, which … Read more

Detailed Explanation of the Facade Pattern in C++ Design Patterns

The Facade Pattern is a structural design pattern that provides a unified high-level interface to a set of interfaces in a subsystem, making the subsystem easier to use. This pattern simplifies the interaction between the client and the subsystem by introducing a facade role, allowing the client to interact only with the facade without needing … Read more

Several Poor Structures/Strategies of Railway Safety Embedded Software

In today’s context of empowering and innovating various railway products, including safety products, discussing such fundamental issues seems like emerging from a pile of old papers. However, the designs we occasionally see remind us that while running smoothly is indeed impressive, ensuring stability is always the most basic and important thing. From a technical perspective, … Read more

Designing Classes and Modules in C++ After Ten Years: Insights from Real Project Structures

Designing Classes and Modules in C++ After Ten Years: Insights from Real Project Structures

From WeChat Official Account: Programmer Cat In my first year of writing C++, I thought “as long as it runs, it’s fine”; by the third year, I started to emphasize “encapsulation, inheritance, and polymorphism”; it wasn’t until the tenth year that I realized: designing a good class and module is far more challenging than just … Read more

In-Depth Analysis of the C++ Visitor Pattern: Structure, Advantages, Disadvantages, and Application Scenarios

In-Depth Analysis of the C++ Visitor Pattern: Structure, Advantages, Disadvantages, and Application Scenarios

1.Introduction In C++ design patterns, the Visitor Pattern is a type of behavioral design pattern whose core idea is to separate data structures from data operations, allowing new operations to be defined without modifying existing object structures. This pattern is particularly suitable for scenarios where the data structure is stable but operations change frequently, such … Read more

Common Software Architectures for Microcontroller Development

Common Software Architectures for Microcontroller Development

Microcontroller programs are familiar to everyone, but few truly consider the architecture used. As program development continues to increase, having a solid architecture becomes essential. 1. Time-Slice Polling Method This is a program architecture design scheme that lies between sequential execution methods and operating systems. This design scheme aims to help embedded software developers elevate … Read more

How to Achieve Clear Architectural Design in Embedded Systems?

How to Achieve Clear Architectural Design in Embedded Systems?

In embedded system development, the visualization and documentation of software architecture are often overlooked, leading to difficulties in project maintenance and chaotic team collaboration. The C4 model created by Simon Brown (Context, Containers, Components, Code) clearly presents software architecture in a layered and progressive manner, making it particularly suitable for resource-constrained and increasingly complex embedded … Read more

How to Digest Knowledge of an Unfamiliar Topic Like RTOS?

How to Digest Knowledge of an Unfamiliar Topic Like RTOS?

Many people, especially students who tend to think in a rigid way, believe that they must thoroughly understand the underlying principles of a technology, such as configuring registers to use a microcontroller, examining task scheduling algorithms, time-slicing, and critical section protection, before they can claim to have learned it. What happens? After much effort, you … Read more