Created
July 5, 2012 06:19
-
-
Save adamralph/3051724 to your computer and use it in GitHub Desktop.
RE: 3047138
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Different | |
{ | |
private ISomething something; | |
public Different(ISomethingProvider somethingProvider) | |
{ | |
this.something = somethingProvider.Provide(); | |
} | |
} | |
public class SomethingProvider : ISomethingProvider | |
{ | |
ISomething Provide() | |
{ | |
if (...) | |
{ | |
return new SomethingA(); | |
} | |
else | |
{ | |
return new SomethingB(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment