New answers tagged class-design
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(...
Top 50 recent answers are included
Related Tags
class-design × 457object-oriented × 141
object-oriented-design × 90
c# × 77
design × 63
design-patterns × 53
java × 50
c++ × 50
class × 36
python × 32
class-diagram × 25
inheritance × 23
php × 19
uml × 19
architecture × 16
programming-practices × 15
coding-style × 15
single-responsibility × 15
methods × 13
solid × 12
refactoring × 11
interfaces × 11
constructors × 10
database × 9
encapsulation × 9