Skip to content

Code Quality: Introduce IStorageQueryService and IStorageEnumerationService #8974

@cinqmilleans

Description

@cinqmilleans

Decoupling Items in the Filesystem Folder

This issue discusses the migration from Storage to the backend. This step is preliminary to the ListedItem refactor.
With this discussion, we can parallelize the changes to save time. @lukeblevins @d2dyno1 @gave92

Objectives

Items in the Filesystem folder should be removed from unwanted dependencies.

  • Concerning localized texts. These dependencies can remain because the backend uses them. There are some cases where localized text is used to identify types. It would be better to use a enum or non-localized string but that can be done after the migration.
  • Regarding dependencies on ListedItem and its derivatives. They prevent migration but are easy to remove by reversing the dependencies.
  • The ViewModel and App dependencies are very annoying and you have to find the right way to remove them.
  • Settings dependencies should be replaced by properties. This is the case with enumerators.

We take the opportunity to rework the style to clarify the files. The order of the elements is completely random. PRs are already pending. We can also check what is should be public or not. It will also be necessary to manage nullables because the backend manages them differently.

Potential work item ideas

  • Clarify the utility and rationale for BaseStorageFolder|File in the docs
  • Replace FolderSearch.cs with an implementation of a standard Backend service
  • Add IStorageQueryService with the member: bool IsAvailable(string directoryPath) to easily verify support for the implementation's filesystem API on a provided location (this would be done before performing the query)
  • Create a separate IStorageEnumeratorService which only handles instantiation of backend file or folder items from already retrieved paths or native filesystem API constructs (IStorageQueryService will return IList<string>)
  • Evaluate different types of parameters for the member functions of IStorageEnumeratorService. I like the concept choosing whether the items should have partial, full, or extended properties populated upon creation, but we could optionally go further and support a set of specific, core property system strings here.

------ And even more coming soon ------

Metadata

Metadata

Assignees

Projects

Status

📋 Planning stage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions