haacked / Rothko

An abstracted library for interacting with the file system, registry, etc.
MIT License
81 stars 18 forks source link

First implementation of FileSystemFacade #12

Closed pmacn closed 10 years ago

pmacn commented 10 years ago

Needed an injectable/testable way to get IDirectoryInfo objects from paths. Figured I would propose adding this here as I'm sure there are other people who might need it. Or at least as an attempt to start a discussion on changes needed to make it fit.

This is by no means a complete example of what a IFileSystemFacade might look like but it's got the methods that I needed at the moment plus a few overloads for great good.

haacked commented 10 years ago

So FileFacade maps to the static System.IO.File methods. Following that pattern, this should probably be DirectoryFacade no?

pmacn commented 10 years ago

If the intent of IFileFacade is to wrap the System.IO.File methods then I agree that an IDirectoryFacade should exist, but I'm not sure this shouldn't exist as well.

So rather then being a wrapper this would be an attempt at making a better abstraction (eventually) for basic get, create, delete interaction with files and directories. Setting things like reading/writing files and manipulating directories aside for other interfaces.

haacked commented 10 years ago

Seems legit. I think I need to rename the other classes then. They're not really "facades" in the same way this would be.