I'm a beginner in OOP and I want to create a program with three classes, A, B, and C. Each instance of the class is defined by a set of characteristics, Achar1, Achar2 etc.
The program is supposed to create uses comprising of element of A, element of B and element of C with begin and end date. There are subclasses of A and B, so that some elements of A can only be connected to certain elements of B. The main functionality of the program is to list elements of A, B and C with their aributes, list uses and suggest new uses that would emply the instances of classes used the least to avoid repetition.
My first instinct is to use three dictionaries A, B and C and a dictionary for uses. This seems intuitive and easy to import/export into json or similar. I tried to rewrite it to employ classes, but I can't see any gain in doing so: it's hard (?) to iterate over instances of classes and also they basically are dictionaries since this data doesn't need much else.
What am I doing wrong? What can I gain from switching from dictionaries to objects?
Edit: the code in question (dict-based) is here. The first version, where I tried to make it object oriented is here.
What if you just extend each class from dict and personalize their behavior?
I mean... they will still be dictionaries, will work as dictionaries, but you can define a few methods of your own.
Edit:
Ok... I read your code and tried to do some OOP from it. Not really the best OOP ever, but you can get the idea. Code is cleaner, easier to debug, easier to extend, easier maintenance, and so on...
Here is the dropbox folder: https://www.dropbox.com/sh/8clyys2gcnodzkq/AACXhPnCW5d9fx0XY6Y-y_6ca?dl=0
What do you think?