jeudi 18 janvier 2018

How to dependency inject folders?

What is the best way to dependency inject folders?

I have a class that needs three folders. It reads files from a subfolder structure from the first folder and writes the files it collected from there to the other folders, also structured in a specific way. Specifically I want to split data for machine learning algorithms into training and test data while the subfolders represent different categories for images which are going to be classified, but that should not matter that much.

So, what is the best way to inject these folders while still having easy testable code? Should I just pass a string? Should I pass a FileInfo object? Should I build a Interface, which represents a wrapper for the folder structure? What is the best way to handle this?

A C# approach was the best, but is not necessary.

Let me know, if information is missing.

Aucun commentaire:

Enregistrer un commentaire