Refactoring the .Net Framework
What possible reason could there be for sealing the System.IO.File class? A sealed class means I must wrap the class just to have my own functionality, rather than extending it. Further, it becomes significantly painful to mock the class in unit tests without an interface.
Granted, Microsoft is doing mucho better these days, and I doubt this decision would be made today if they were re-releasing the framework. So why not go in there and unseal things like this as a service pack? Look at what the ASP.Net team has done for IHttpContext as an example. Good stuff.
I know I am not the first or last person to rant about these things, but here’s my question. Why can’t these refactorings be released into subsequent versions of the framework?
The “Extract Interface” refactoring is a pretty easy one.


