C# 15 Closed Hierarchies: Sealed-by-Default Class Clubs
C# 15 adds closed hierarchies to limit subclassing to the defining assembly, improving API safety and exhaustive pattern matching.
Radar snapshot
The feature has no standalone business model, but it is useful for indie library and framework authors who ship public C# APIs. It is less relevant to solo builders working on apps rather than reusable components. How we score
Business breakdown
There is no direct monetization; the value flows to Microsoft's .NET ecosystem, IDE vendors, and enterprise tooling. Target users are C# library authors and platform teams that need controlled extensibility without fully sealing types. Market opportunity is ecosystem stickiness and paid developer tooling, not the language feature itself.
Use it if…
C# library and framework authors who need controlled extensibility without fully sealing public base classes.
Skip it if…
Developers outside .NET or those building plugin systems that require external assemblies to subclass core types.
Alternatives & competitors
| Option | Positioning | Pricing |
|---|---|---|
| C# sealed classes | Sealed blocks all inheritance, while closed hierarchies allow subclassing only within the defining assembly. | Free language feature |
| Java sealed classes and interfaces | Java uses explicit permits clauses; C# closed hierarchies use assembly-scoped closure for a simpler default. | Free language feature |
What an indie dev can do with this
- Prototype a small internal library with one public base class marked closed and test external inheritance failures.
- Replace fragile sealed-plus-internal-constructor patterns where exhaustive matching and controlled extension matter.
- Document the allowed subclass set for consumers and add analyzer or test coverage for external inheritance attempts.
FAQ
- Is C# 15 closed hierarchies available in stable .NET?
- It is a preview feature in C# 15; check the .NET preview SDK and enable the matching language version.
- Does it replace sealed classes?
- No. Sealed blocks all inheritance; closed restricts subclassing to the same assembly, so use it for controlled extension points.
- Can external plugins subclass a closed class?
- No, external assemblies cannot inherit from it; expose interfaces or explicit extension points for plugin scenarios.