So lets take this example that I have a class A and class B both A and B are implementing a specific interface letters. Now I need to make a specific function in another class wherein I need to pass either A class object or B class object and similarly do some operation on these objects and return either A
Tag: object-oriented-analysis
Composition or Inheritance for classes with almost similar implementations but different input and outputs for methods?
I have the following classes, which have quite similar method implementations. Only the classes’ method inputs and outputs seem to be of different types. When I put it like this, it sounds like a case for inheritance, however, the fact that the inputs and outputs are different and are related to two lambdas, make me wonder if they should remain