PowerSystemDataModel icon indicating copy to clipboard operation
PowerSystemDataModel copied to clipboard

Refactoring `CsvFileConnector` and `CsvDataSource`

Open sebastian-peter opened this issue 1 year ago • 0 comments

What I think this should look like is *Connectors taking care of operations close to the file system, and *DataSource handling higher-level decisions, i.e. where data is stored (paths/databases/etc.). With SqlConnector and SqlDataSource, this division is already in place.

Illustrating the desired change with examples in two areas:

  • Different exception handling CsvConnector should then throw (or return within Trys) ConnectorExceptions, and CsvDataSource should throw (or return within Trys) SourceExceptions.
  • Separate FileNamingStrategy from CsvFileConnector Currently, CsvFileConnector uses the FileNamingStrategy to determine paths of some entities. This is happening less with #999, and should arguably move to CsvDataSource anyways. CsvFileConnector should not care where a path comes from, it should just deal with it.

sebastian-peter avatar Feb 06 '24 20:02 sebastian-peter