Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file and directory path separate abstractions #58

Open
rodion-m opened this issue May 21, 2024 · 1 comment
Open

Add file and directory path separate abstractions #58

rodion-m opened this issue May 21, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed status:to-discuss Issues that deserve more discussion

Comments

@rodion-m
Copy link

For example, https://github.com/ndepend/NDepend.Path has IAbsoluteFilePath, IAbsoluteDirectoryPath, IRelativeDirectoryPath and IRelativeFilePath . It'd be great to see such abstractions in TruePath too.

@ForNeVeR ForNeVeR added enhancement New feature or request help wanted Extra attention is needed status:to-discuss Issues that deserve more discussion labels May 21, 2024
@ForNeVeR
Copy link
Owner

ForNeVeR commented May 21, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed status:to-discuss Issues that deserve more discussion
Projects
None yet
Development

No branches or pull requests

2 participants