Skip to main content

New answers tagged

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 ...
guest271314's user avatar
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 ...
Bart van Ingen Schenau's user avatar
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(...
Caleth's user avatar
  • 12.4k
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 ...
Doc Brown's user avatar
  • 220k
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" ...
Martin Maat's user avatar
  • 18.6k
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 ...
Doc Brown's user avatar
  • 220k

Top 50 recent answers are included