Created
March 1, 2021 02:13
-
-
Save ThiagoBarradas/eb4da2cc2350842f17688edddc67a14d to your computer and use it in GitHub Desktop.
SOLID [I] - Interface Example with and without Inheritance
This file contains hidden or 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 interface IBomb | |
{ | |
void Explode(); | |
} | |
public interface IHuman | |
{ | |
string Name { get; set; } | |
string Document { get; set; } | |
long Age { get; set; } | |
} | |
public interface ITerrorist : IHuman, IBomb | |
{ | |
} | |
/// class samples | |
public class SomeTerrorist1 : IHuman, IBomb | |
{ | |
/// ... | |
} | |
public class SomeTerrorist2 : ITerrorist | |
{ | |
/// ... | |
} | |
public class SomeTerrorist3 : IHuman, IBomb, IMovable | |
{ | |
/// ... | |
} | |
public class SomeTerrorist4 : ITerrorist, IMovable | |
{ | |
/// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment