My code looks like this.
So when the project grows larger, more number of objects will be created. Is that okay? Considering the garbage collection, memory usage of the application, etc?
Or is there any better way to do that?
from wq import x from ew import y from fa import z from oh import a from la import b from ha import c class Sample: def __init__(self): self.x = X() self.y = Y() self.z = Z() self.a = A() self.b = B() self.c = C() def calculate_something(self): self.answer = self.a.getValue() + self.b.getAnswer() + self.c.getOptions() + self.x.getVehichles() ....Likewise I have to import all required classes from other sub directories and create an instance of them within my Sample class __init__. Here I had to create objects 6 objects of 6 classes. Then SampleTwo class has similar set of dependencies and it will also import around 4 classes and create instance of that within SampleTwo class's __init__ method.
So when the project grows larger, more number of objects will be created. Is that okay? Considering the garbage collection, memory usage of the application, etc?
Or is there any better way to do that?