https://github.com/haacked/rothko
An abstracted library for interacting with the file system, registry, etc.
https://github.com/haacked/rothko
c-sharp filesystem testability
Last synced: about 1 year ago
JSON representation
An abstracted library for interacting with the file system, registry, etc.
- Host: GitHub
- URL: https://github.com/haacked/rothko
- Owner: haacked
- License: mit
- Created: 2012-06-14T22:03:49.000Z (almost 14 years ago)
- Default Branch: main
- Last Pushed: 2020-06-11T00:12:42.000Z (almost 6 years ago)
- Last Synced: 2025-03-21T19:01:34.897Z (about 1 year ago)
- Topics: c-sharp, filesystem, testability
- Language: HTML
- Size: 22.1 MB
- Stars: 81
- Watchers: 8
- Forks: 18
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Rothko
We all know the .NET Framework APIs for dealing with the file system are not
designed with testability in mind. Also, I wasn't happy with the existing
libraries for providing an abstraction for such things. I wanted one that was:
* Modern - Included the `Enumerate*` methods for example.
* Interface based - Using Abstract base classes as the abstraction is blech.
* Easy to port to - So it had to follow the existing APIs closely.
Rothko is this library. It provides abstractions for:
* File system.
* Registry
* Environment.
The starting point for Rothko is the `OperatingSystemFacade` class. From there
you can get to the other abstractions.
* `IFileSystem`
* `IEnvironment`
* `IRegistry`
# Goals
The goal is to use this in GitHub for Windows as well as any other
applications where testability is important.
A secondary goal is to make it very easy to port code using the core .NET
Framework APIs to port over to Rothko. The interfaces map closely to the
.NET Framework's, except in a few places where I wouldn't be able to live with
myself if I didn't modernize the library. For example, I updated methods
that return arrays to return `IEnumerable` (or derived interface) instead.
Once these low level abstractions are implemented, I plan to add a set of
_Facade_ classes that provide a more usable API that we all wished had been
there all along. These _Facade_ classes will simply delegate to the
lower-level abstractions.