patterns/templatemethod/barista/app.d

22 lines
489 B
D

import std.stdio : writeln;
import coffee, tea, coffeewithhook, teawithhook;
void main()
{
auto tea = new Tea();
auto coffee = new Coffee();
writeln("\nMaking tea...");
tea.prepareRecipe();
writeln("\nMaking coffee...");
coffee.prepareRecipe();
auto teaHook = new TeaWithHook();
auto coffeeHook = new CoffeeWithHook();
writeln("\nMaking tea...");
teaHook.prepareRecipe();
writeln("\nMaking coffee...");
coffeeHook.prepareRecipe();
}