-
-
Save lgolubyev/bec07df33e8106345207301064cf0d7e to your computer and use it in GitHub Desktop.
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 abstract class EmployeeBase | |
{ | |
protected virtual void Work() | |
{ | |
// ....working | |
} | |
} | |
public class Human : EmployeeBase | |
{ | |
public override void Work() | |
{ | |
//.... working much more | |
} | |
} | |
public class Robot : EmployeeBase | |
{ | |
public override void Work() | |
{ | |
//.... working much, much more | |
} | |
} | |
public class Manager | |
{ | |
private readonly Robot _robot; | |
private readonly Human _human; | |
public Manager(Robot robot, Human human) | |
{ | |
_robot = robot; | |
_human = human; | |
} | |
public void Manage() | |
{ | |
_robot.Work(); | |
_human.Work(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment