Nov-03-2019, 07:52 AM
(This post was last modified: Nov-03-2019, 10:15 AM by AlekseyPython.)
(Nov-02-2019, 08:57 AM)DeaD_EyE Wrote: Maybe you can post some example code with example data.
Presenting the code will be difficult, because it is scattered across multiple files. But the main idea is quite simple to state: I have a set of csv- files, separated by the month. My task is to execute high-level business logic on each line from these files. The architect is represented by the following components:
1. Command - works with business logic for each line of file.
2. Storage - allows to change the way data is stored (files, database, internet, generation...), i.e. makes a call to the selected method of data storage.
3. DatŠ° - organizes enumeration of files in the desired date range.
4. Converter - convert data from str to needed types.
5. File - actually receives the data from csv- file.
See how deep a call stack is for each line of data from a file? With such a stack, the overhead significantly exceeds the complexity of the useful work (i.e. parsing the string).