Skip to main content

Questions tagged [multiple-inheritance]

2 votes
1 answer
144 views

In my project I have several "basic" interfaces whose behavior is fixed, i.e. the default implementation will always be good for every puropse. So I defined them as concrete classes with ...
Nicola Mori's user avatar
18 votes
8 answers
14k views

I know there have been many post about diamond problem, one of it: Why do you reduce multiple inheritance to the diamond problem?. But I'm not asking what it is or what is the solution of the problem. ...
wcminipgasker2023's user avatar
0 votes
0 answers
589 views

Because I have multiple entities with unique fields, I need multiple repositories for each one even though each Entity will be handled exactly the same. What is the best way to handle these separate ...
dbrewster's user avatar
  • 139
-1 votes
1 answer
884 views

C++ and Python are the only two languages I know supporting multiple Inheritance. Other object oriented languages I have seen like Java and Ruby do not support multiple inheritance. Even the front-end ...
Arunabh's user avatar
0 votes
1 answer
72 views

I want to model a machine with a class machine. By the way the architecture of the project has been built, the module that defines each machine is its own directory. So in directory manufacturer/...
TeXtnik's user avatar
  • 101
0 votes
1 answer
88 views

Lets imagine some vendor code that we want to extend on our project level protected function getDefaultFormClasses() { return [ new FormClassA(), new FormClassB(), new ...
Jim Panse's user avatar
  • 408
2 votes
1 answer
320 views

I have a lot of classes that are just a CRUD interface for microservices. They only have a param for the endpoint and some of the methods get_list / get_item / create / update / delete / activate / ...
xpy's user avatar
  • 129
6 votes
3 answers
9k views

I am writing a Python framework. In order to ensure a class has some properties, I make base "interface" classes like: class BananaContainer: def __init__(self): self._bananas = [] @...
mguijarr's user avatar
  • 226
2 votes
1 answer
271 views

I want to use a physics engine (like bullet or PhysX) in my program, however I want to hide the actual physics engine from it, so I can easily swap it out with another during run-time (e.g. switch ...
user225183's user avatar
2 votes
1 answer
369 views

I'm writing a program that will interface with an external device. It will support numerous devices that may use different communication interfaces like USB, serial, etc. This is what I have so far: ...
John O'brien's user avatar
2 votes
4 answers
5k views

In my previous question, it was highlight that implementations of C++ such as GCC must store a vtable pointer in every copy of a class for each parent class which has a virtual function. So a class ...
Clinton's user avatar
  • 1,093
18 votes
2 answers
19k views

Is it a code smell if the methods in my trait refer to parent::methods or to methods that are assumed to be in the utilising class? A random (senseless) example trait foo { public function bar() ...
Kamafeather's user avatar
0 votes
3 answers
157 views

I am currently creating Excel import modules for some complex data. I didn't plan it well and I have met code reuse issues. I have made first modules and I realized that next modules will need some ...
helvy91's user avatar
  • 29
1 vote
1 answer
115 views

How do you handle fat interfaces? Here is an example: public class TSP { public AddEmployeeContribution(...) {...} public AddMatchingContribution(...) {...} public CalculateTotal() {...} ...
keelerjr12's user avatar
  • 1,273
-1 votes
1 answer
157 views

I have a statement. I know the ups and downs of both Composition and Inheritance, but I am unable to realize that what would be the best option the given scenario. SCENARIO: A Software company is ...
Khubaib Khawar's user avatar

15 30 50 per page