Hello, I have a good doubt.
We have a defined class (Class A) and services (ServB, ServA …)
These services use this class. "Class A"What happens to it? Class A Can be defined as a service, for example; Then we have the following:
The Serva Requires the services A, B and Class A but Class A Can be instantiated as new Class A (); o It could be faded in as a service in the constructor Servaand from the ServBand ServC ETC and so we say X-services more.
It would be better for services than the instance of performance in terms of performance Class A this interior as an injection or as an instance of the new ClassA ()? …
In this case I understand (if the theory does not fail me) that I make it new ClassA () Each time you need the service, it's a new object with its memory usage, and so on. Each service uses three services. When three services are used, there are 3 different new objects each with their respective memory usage, BUT. Does the same thing happen when it is injected? or the memory load is lower, the part that I have tried to understand, and I do not realize !!!
Help me to upload my level Guru SF !!