Does this violate the “Dependency Inversion Principle”?

Ideally you would inject the factory into the TestConnection (i.e. It would take a ConnectionFactory as a parameter, by an interface) rather than calling "new" to get a factory. That way the TestConnection doesn't depend either on the concrete implementation of the Factory or of the Connection.

While it can be argued that your general architecture is not the best way to go about implementing database connections, I'll skip that as I understand the question to be more about Dependency Inversion rather than database implementation. To achieve full Dependency Inversion.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions