EnriqueMark
Design Patterns & Architecture

Decoupled design

2026-03 English

The core of a design philosophy like dependency injection still comes down to one word, decoupling. Simple interface, complex core. What the abstraction exposes is the simple part, and the actual process is wrapped inside the implementation. When my class is built on an abstract structure, I don’t need to care how the concrete implementation works, which makes adding or removing features easy. I don’t have to go change the code of the core class every time a new requirement shows up. I only have the new classes inherit one shared interface, or framework, and then throw them at the core class. Done.

Of course you also have to watch out for over-engineering, and that’s where experience shows. But I believe that if you stick to this principle when you write, you naturally produce more solid, maintainable code. Engineering doesn’t always chase perfection either, you also weigh schedule and cost, and that part matters. Obviously I have no need to over-engineer a one-off requirement, but if it needs regular maintenance, then keeping the code sturdy is what matters most.


Translation note. I wrote this in Chinese. This English version is an LLM translation, so the wording is not mine even though the thinking is. Original: 解耦设计.