Next badge 0/1
~3k people reached
- 0 posts edited
- 0 helpful flags
- 0 votes cast
Why was dependency injection pattern not included in the Gang of four?
These long responses are probably misleading, as they kind of validate the question. While, as mentioned, dependency injection is not a design pattern. It is a "mechanism" for object instantiation, typically handled by the framework.
Why do we need private variables?
The usage and difference of private and public variables, and why we have them, can only be understood in the context of general Object-oriented principles. It cannot be understood separately. You probably need to look at it from that perspective, things may get clearer.