有关一个设计模式的简单问题请指教

using System; using System.Collections.Generic; using System.Text; namespace test2010 { class Program { static void Main(string[] args) { birdTweetAdapter ch = new birdTweetAdapter(new chicken()); ch.Showtype(); ch.Tweet(); Console.ReadLine(); } } interface BirdSing { void Tweet(); } class birdTweetAdapter:BirdSing { private Bird _bird; public birdTweetAdapter(Bird bird) { _bird = bird; } public void Showtype() { _bird.showtype(); } public void Tweet() { Console.WriteLine("叫一下"); } } class Bird { public string Name { get; set; } public void showtype() { Console.WriteLine(this.Name); } } class chicken:Bird { public chicken() { base.Name = "鸡"; } } class durk : Bird { public durk() { base.Name = "鸭"; } } }
现在通过适配器实现了在不改变之前设计的情况下加了鸟叫的功能,现在的问题是如何在不改变设计的情况下为每个子类实现特殊的鸟叫方法,如鸡是鸡叫,鸭是鸭叫。请问各位大侠


