Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created May 24, 2022 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgolubyev/bec07df33e8106345207301064cf0d7e to your computer and use it in GitHub Desktop.
Save lgolubyev/bec07df33e8106345207301064cf0d7e to your computer and use it in GitHub Desktop.
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