Microkernel (Plugin)
Minimal core offering base services, extended by plugins.
Context
Products extensible by third parties: IDEs (VS Code), browsers, ERPs, CMSs.
Solution
A core exposes stable APIs. Each optional feature is a plugin discovered at runtime.
public interface IPlugin { string Name { get; } void Register(IServiceCollection s); }
// El núcleo descubre plugins:
foreach (var plugin in DiscoverFromFolder("./plugins"))
plugin.Register(services);Tradeoffs
| Pro | Con |
|---|---|
| Extensible without touching the core | Designing stable APIs is difficult |
| Customization per client | Compatibility between plugin versions |
#architecture #plugins