Usually with OO and Inheritance, if reusing a function at that time is not known, it is usually best to implement this function several times until you define a template that allows you to break it down.
For example, there is nothing wrong with the fact that a class object is a data container and inherits from it.
class IdentificationData { int ID; . . . }
In addition, it is not necessary that the functions be part of the class. A class is just a container and is used to organize and encapsulate data, functions that can work with data, or a set of functions in one common set.
class IdentificationFunctionality{ static SetID( IdentificationData* obj) {...} }
Doing this will allow you to do something like ...
class AB: IdentificationData, B { . . . } AB* ab = new AB(); IdentificationFunctionality::SetID(&ab);
Other advantages of this is that it allows you to make some books without your objects, which should know the details of the banking data processing system.
source share