Last active
October 12, 2020 09:25
-
-
Save carmeleve/da7cf32b8b226cee942bf703dfbe177c 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
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace DesignPatterns.Adapter | |
{ | |
public class TriceratopsToMammalAdapter : IMammal | |
{ | |
private readonly Triceratops triceratops; | |
public TriceratopsToMammalAdapter(Triceratops triceratops) | |
{ | |
this.triceratops = triceratops; | |
} | |
public IChild GiveBirth() | |
{ | |
TriceratopsEgg egg = triceratops.LayEgg(); | |
IChild child = egg.Hatch(); | |
return child; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment