New interfaces, future-proofing and CoreFX


#1

I considered adding a suggestion to have IFileInfo/IDirectoryInfo etc in the Core Framework — this would be very useful for mocking. In fact there are a few libraries that exist only to provide interfaces/adapters, including one in ASP.NET vNext (https://github.com/aspnet/FileSystem).

However this would effectively block any future additions to those APIs, as new properties/methods on an interface would be a breaking change.

Is it a good idea to unseal those types and make all methods virtual? Is there a better solution?


#2

There’s a related discussion about FileSystem APIs on GitHub: https://github.com/dotnet/corefx/issues/312


.NET Foundation Website | Blog | Projects | Code of Conduct