patterns/templatemethod/barista/caffeinebeverage.d

29 lines
401 B
D

module caffeinebeverage;
import std.stdio : writeln;
abstract class CaffeineBeverage
{
final void prepareRecipe()
{
boilWater();
brew();
pourInCup();
addCondiments();
}
void brew();
void addCondiments();
void boilWater()
{
writeln("Boiling water");
}
void pourInCup()
{
writeln("Pouring into cup");
}
}