easybuild-org / easybuild-org/EasyBuild.FileSystemProvider
Explore the idea of returning `DirectoryInfo` or `FileInfo` instead of `string`
- Ngôn ngữ chính
- F#
- Star
- 35
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
The more I use this project, the more I find myself needing to transform the `string` into a `DirectoryInfo` or `FileInfo` which better represents a directory or file.
Indeed, a `string` is not well typed in term of Domain and can be anything.
Access a the `string` representation from both these types is easy enough by using `.FullName` where the other direction is a bit more convoluted.
I am wondering if we should not convert the TP to expose these return type instead of the string.
Ideas:
1. We go full breaking change and only expose `DirectoryInfo` or `FileInfo` API
2. We look to see if it is possible make `RelativeFileSystem` and `RelativeFileSystem` take an argument to configure their output
3. We create 2 modules to split the API and the user can choose the version he prefers:
```fs
module EasyBuild.FileSystemProvider.Typed
// or
module EasyBuild.FileSystemProvider.Infos
type RelativeFileSystemProvider(config: TypeProviderConfig) =
// ...
// Returns `DirectoryInfo` or `FileInfo`
module EasyBuild.FileSystemProvider.UnTyped
// or
module EasyBuild.FileSystemProvider.Simple
// or
module EasyBuild.FileSystemProvider.Strings
type RelativeFileSystemProvider(config: TypeProviderConfig) =
// ...
// Returns `DirectoryInfo` or `FileInfo`
```
I think I am in favor of option 1, because if people want to access the string value they just need to add `.FullName` and it makes less code to maintain 😇
Note: In regard of https://github.com/easybuild-org/EasyBuild.FileSystemProvider/issues/3, I think we will expose these APIs:
```fs
Workspace.src.``.``
// One of these variations
Workspace.src.GetInfos()
Workspace.src.Infos()
```
@shayanhabibi @JordanMarr Any opinions?
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu bằng việc xem xét RelativeFileSystemProvider và API hiện có trả về string, sau đó so sánh ba tùy chọn tương thích được mô tả trong issue. Issue 3 được liên kết có thể cung cấp bối cảnh cho các API GetInfos hoặc Infos được đề xuất. Công việc được xem là hoàn tất khi dự án đã quyết định chiến lược về kiểu trả về và API, đồng thời ghi lại các tác động của chiến lược đó đối với khả năng tương thích.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- fsharp
- Lĩnh vực
- tooling
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100