c# Programming Glossary: electricduck
Can you explain Liskov Substitution Principle with a good C# example? http://stackoverflow.com/questions/4428725/can-you-explain-liskov-substitution-principle-with-a-good-c-sharp-example IsSwimming get return if the duck is swimming public class ElectricDuck IDuck bool _isSwimming public void Swim if IsTurnedOn return.. like this void MakeDuckSwim IDuck duck if duck is ElectricDuck ElectricDuck duck .TurnOn duck.Swim But that would break Open.. this void MakeDuckSwim IDuck duck if duck is ElectricDuck ElectricDuck duck .TurnOn duck.Swim But that would break Open Closed principle..
|