I'm still finding my feet with OOP and I am in a conundrum on how to procede with a design. I have some files. They all have headers and they all have data. There are several (25 or thereabouts) file types. Each file type has: a name, a header type, a data format, and a data reader (i.e. a method I will write to read the data of a particular file type). A particular "data reader" might read data from more than one file type.
Ultimately, I need data sets. A data set has all of the above attributes plus: all the data read in from the source file, and a couple of other bits of info such as the file name.
Like I said, I will have 25 or so file types, and a run of the code might deal with a few hundred data sets. file types will be very stable. More might be added as time goes on, but the attributes of existing file types will hardly ever change, and certainly not within the course of a run. In a data set, the actual data might change with processing, but the attributes of its associated file type will not.
The first step in dealing with a file will be to read its header and figure out what file type it belongs to. Next, the data set will be constructed by calling the data reader for the appropriate file type.
Now, I am stuck on the best way to get the file type attributes into the data set. Will it be more workable to say that a data set is-a "file type" and let data set inherit from (or just simply instantiate) file type, or better to say that a data set has-a file type and let file type be a data set attribute? I have to do this in python. Are there any python-specific considerations in answering this question. Thanks for your help.