Created
May 27, 2011 02:49
-
-
Save paulbatum/994550 to your computer and use it in GitHub Desktop.
This is just one reason why we need interface inheritance
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
IList<string> list = new [] { "I", "declare", "you", "are", "mistaken", "sir" }; | |
IEnumerable<string> youProposeIShouldNotBeAbleToDoThis = list; | |
// For the above code to work, IList<T> must inherit from IEnumerable<T>, i.e. interface inheritance must exist. |
So really you're for Interface segregation. I agree. In this case it seems like Command/Query separation. Happens a lot.
I think I would understand better if you present A) this is how it was B) this is how it should be
Yeah that's pretty much it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
so what caused the issue today was something like this... granted it might consider "bad code".
public interface IThingRepository : IRepository
{
Thing GetSomeSpecialThing(IQueryObject);
}
implementation : (BaseRepository implements IRepository)
public class ThingRepository: BaseRepository, IThingRepository
{
.....
}
so some code that uses IThingRepository needs to have the save method from IRepository mocked ... so yeah we have a problem...
@skoon that's what we ran into right?? I think I remember it correctly....