3 ms·
This isn't just a design principle for .NET libraries, it's a SOLID design principle. All classes should be inextensible unless they are explicitly designed to
by tdbgamer 8y ago
This isn't just a design principle for .NET libraries, it's a SOLID design principle. All classes should be inextensible unless they are explicitly designed to be extended.
- davedx 8y agoThe open/closed principle doesn’t say that. It says classes should be “open for extension” (usually meaning you are able to inherit from them and add functionality) and “closed for modification”, meaning you aren’t able to change internal implementations. It does not say “everything should be closed by default unless explicitly marked otherwise”...
- geezerjay 8y agoComposition is still an option, and arguably the default option. Sealing a class does not prevent anyone from extending the functionalities offered by a class.