标签:des style blog io color sp for div log
void Main() { Template ta = new ProductA(); Template tb = new ProductB(); ta.Show(); tb.Show(); } abstract class Template{ public void Show(){ string.Format("Template->{0}",GetName()).Dump(); } protected abstract string GetName(); } class ProductA:Template{ protected override string GetName(){return "A";} } class ProductB:Template{ protected override string GetName(){return "B";} }
DesignPattern_Behavioral_TemplateMethod
标签:des style blog io color sp for div log
原文地址:http://www.cnblogs.com/rammderek/p/4103148.html