New answers tagged object-oriented
0
votes
Should I instantiate controllers in route modules or use static methods?
I’d like to understand the trade-offs regarding scalability and testability.
Looks to me like there's no scalability and testability, because your current approach does stuff with router and ...
1
vote
Accepted
How to reduce the number of class instances passed to the __init__() method of a Python class?
The answer by @Caleth shows nicely how to reduce the instance variables in FunctionsManager. To also reduce the argument list when creating a FunctionsManager object, you can turn the creation logic ...
1
vote
How to reduce the number of class instances passed to the __init__() method of a Python class?
It looks like you need a list, not an ever-expanding number of variables.
class FunctionsManager:
def __init__(self, *instances):
self.__instances = instances
def handle_received_data(...
2
votes
Accepted
Is it okay to mix OOP and modular approaches when building a backend with TypeScript/JavaScript?
Most contemporary programming languages allow to use different paradigms like OOP or functional programming. This alone is neither good nor bad per se. However, when those different styles are mixed ...
0
votes
Convenience inheritance
I don't quite understand your problem but going by the one example you provide you may think of it differently and the following may apply in more cases.
Circle does not have an "is a" ...
5
votes
Convenience inheritance
IMHO implementation inheritance is not an anti-pattern in general.
There are too many examples where this works well enough to ban this kind of inheritance dogmatically. You presented a few examples ...
Top 50 recent answers are included
Related Tags
object-oriented × 3434design-patterns × 694
design × 609
object-oriented-design × 520
java × 488
c# × 364
php × 262
c++ × 241
inheritance × 191
python × 159
architecture × 156
interfaces × 153
class-design × 141
solid × 139
domain-driven-design × 124
functional-programming × 96
mvc × 89
programming-practices × 88
class × 88
single-responsibility × 78
encapsulation × 78
refactoring × 74
programming-languages × 67
polymorphism × 65
composition × 65