3 ms·
Classes work well as interfaces to data. Thinking of a class as a mini database makes a lot of sense. Putting in anything complex that isn't directly related
by BubRoss 7y ago
Classes work well as interfaces to data. Thinking of a class as a mini database makes a lot of sense.
Putting in anything complex that isn't directly related to managing the data contained is where things start to fall apart.
Data formats are great. Simple data formats don't have to have dependencies, just an interface to take out the details of accessing it. This is how software communicates. Don't forget that the most used interprocess communication is the file system.
Classes are not modular just because they can be wrapped up between two braces. Dependencies destroy modularity and this definitely includes inheritance. Complex data transformations that communicate using data formats they both understand are how programs are made modular. Classes are a very useful way of dealing with data formats.