应用场景: 复杂对象构建,这些对象是可能不断变化的,但是这些对象的借口是相对稳定的。 实现代码: public interface INormalActor { INormalActor Clone(); } public interface IFlyActor { IFlyActor Clone(); } public interface IWaterActor { IWaterActor Clone(); } // 深拷贝通过序列化实现序列化 [Serializable] public class NormalActorA : INormalActor { #region INormalActor Members public INormalActor Clone() { return (INormalActor)this.MemberwiseClone(); } #endregion } public class NormalActorB : INormalActor { #region INormalActor Members public INormalActor Clone() { return (INormalActor)this.MemberwiseClone(); } #endregion } public class FlyActorA : IFlyActor { #region IFlyActor Members public IFlyActor Clone() { return (IFlyActor)this.MemberwiseClone(); } #endregion } public class FlyActorB : IFlyActor { #region IFlyActor Members public IFlyActor Clone() { return (IFlyActor)this.MemberwiseClone(); } #endregion } public class WaterActorA : IWaterActor { #region IWaterActor Members public IWaterActor Clone() { return (IWaterActor)this.MemberwiseClone(); } #endregion } public class WaterActorB : IWaterActor { #region IWaterActor Members public IWaterActor Clone() { return (IWaterActor)this.MemberwiseClone(); } #endregion } public class GameSystem { public void Run(INormalActor normalActor, IFlyActor flyActor, IWaterActor waterActor) { INormalActor normalActor1 = normalActor.Clone(); INormalActor normalActor2 = normalActor.Clone(); INormalActor normalActor3 = normalActor.Clone(); INormalActor normalActor4 = normalActor.Clone(); INormalActor normalActor5 = normalActor.Clone(); IFlyActor flyActor1 = flyActor.Clone(); IFlyActor flyActor2 = flyActor.Clone(); IWaterActor waterActor1 = waterActor.Clone(); IWaterActor waterActor2 = waterActor.Clone(); } } Client: static void Main(string[] args) { GameSystem gameSystem = new GameSystem(); gameSystem.Run(new NormalActorA(), new FlyActorA(), new WaterActorA()); }