Open rodion-m opened 1 month ago
I believe this deserves more discussion.
My current view on the library is that it should grant the compile-time safety for the provided entities.
While a path could be easily classified as absolute or relative in compile time, and won't ever change its classification, it could easily be changed from a file to a directory (or even to not being existent) in runtime.
I have a vague feeling that this kind of classification is better handled by runtime attributes (such as — methods, properties etc.) than compile-time types.
But I understand the need.
Perhaps we can implement wrappers around our current paths that will additionally check whether they are files or directories at some moment in runtime?
What should be the operational model of these types? NDepend.Path documentation shows allowed operations for IAbsoluteFilePath
but not IRelativeFilePath
. What's the practical difference between file and directory path, from the library standpoint?
For example, https://github.com/ndepend/NDepend.Path has
IAbsoluteFilePath
,IAbsoluteDirectoryPath
,IRelativeDirectoryPath
andIRelativeFilePath
. It'd be great to see such abstractions in TruePath too.