Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is the provider pattern an implementation of IOC?

0
Posted

Is the provider pattern an implementation of IOC?

0

In my opinion, yes the Provider pattern is a form of Inversion of Control. What’s my reasoning? At it’s core IoC is a very generic concept, so much so that Martin Fowler talks about reading user input from the command line as being a form of IoC. With the Provider model the inversion happens when the provider framework decides which provider will be used when a given method is called. For example when you invoke Membership.GetUser your code is delegating control of which Membership provider to use, to the provider framework. As Fowler says “Inversion of Control is a common characteristic of frameworks” and if you think about it many patterns are concerned with IoC (e.g Strategy pattern). I would go as far as to say that even polymophism is a form of IoC (a point I would happily like to hear a counter argument to).

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123