using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace Future.Contract { /// /// 不是“指令”也不是“档案”的其它数据对象的基类 /// [DataContract] public class FutureObject : IFuture { /// /// 深度拷贝对象:将当前对象序列化,再通过反序列化方式创建新对象,从而实现对象的深度拷贝 /// /// 拷贝出的新对象 public virtual IFuture Clone() { throw new NotImplementedException(); } /// /// 对象属性覆盖:用引用对象属性覆盖当前对象属性,对引用属性只会实现引用赋值,不做深拷贝 /// /// 用于覆盖当前对象属性的源对象 /// 如果源对象类型不是当前对象或是其子类类型则直接覆盖失败,返回False public virtual bool Cover(IFuture refer) => refer != null && refer.GetType().IsInstanceOfType(this); } }