5
votes
Accepted
Polymorphism with variable default argument count
The very core of what you're trying to achieve goes against the core principle of polymorphism: interchangeability.
The concept of polymorphism is having the ability to write code that handles an ...
3
votes
Polymorphism with variable default argument count
At first sight, your object hierarchy breaks the Liskov Substitution Principle (the "L" in SOLID), because I cannot substitute an instance of B for an instance of A due to the differing ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
polymorphism × 200object-oriented × 65
inheritance × 32
c++ × 31
c# × 30
java × 29
design-patterns × 25
object-oriented-design × 25
design × 22
interfaces × 19
php × 9
python × 7
abstract-class × 7
refactoring × 6
haskell × 6
abstraction × 6
generics × 6
architecture × 5
c++11 × 5
type-systems × 5
javascript × 4
unit-testing × 4
functional-programming × 4
dependency-injection × 4
functions × 4