3 ms·
Let's say side A is a logger, with each log entry being timestamped. We want to be helpful so we provide way to convert data into MM-DD-YYYY string. These logs
by jmiskovic 7y ago
Let's say side A is a logger, with each log entry being timestamped. We want to be helpful so we provide way to convert data into MM-DD-YYYY string. These logs are transmitted to side B and stored to disk.
Few months later we decide to add another converter, one that gives out YYYY-MM-DD format. New logs can interpret themselves better than old ones, and side B needs to be careful what it can ask of dit file. If there are multiple log sources, then depending on source we have more or less powerful interpretation of _same_ data type, until they are all updated.
To me the code should be stored and managed separately from data. The side B should be responsible for parsing raw data from A. The interpretation shouldn't be bundled with data because same data can be interpreted better in future. The cleanest way I've seen it done is Clojure's spec library for describing and validating data.