jeudi 21 mars 2019

Should exporters and importers splitted into multiple interfaces

Context / Use case:

A customer wants to transfer a small subset of configuration data between two instances of our software by exporting and reimporting that data.

At the moment, there is no import/export feature for that data. Also, there are no other use cases but the transfer foreseeable by now that would include either the export or the import of that data. (But as always: who knows?)

The data is fairly simple. In theory, a small csv file could be enough, so we are not talking about complex files here.

Question:

I basically have two "main" methods, ImportData(..) and ExportData(..), which I define by an interface. Since everything seems so simple and isolated, I could define an IDataIO (or so) interface that defines both methods.

But: Wouldn't that violate the interface segregation principle? Should I rather define two separate interfaces for the import and export, containing one method each? Would that be over-engineered?

Are there any arguments that make this more than an "ivory tower question"?

Aucun commentaire:

Enregistrer un commentaire