Recently, I was asked to express CI in conversation.
I replied:
1) I go to the hotel. I ordered food. The hotel asks me to clean the dishes and clean the tables. So, I am a client, I am responsible for managing the service (create, execute, delete). But DI separates these tasks, so the service consumer does not need to worry about monitoring the life cycle of the service.
2) He also asked if there is any microsoft API after DI? .I answered (that was my guess). In WCF, you can create proxies using ChannelFactory, which controls the lifetime of your factory.
for paragraph (1) he said that only 10% is correct
for item (2), he said it was a factory pattern that was independent of injection.
Actually, what went wrong in my explanations (except for my bad English)? What are the real answers for them?
I look forward to your valuable suggestions.
source
share