原本在 python 或者 c++这种多继承语言中可以实现如下继承逻辑
class TableFootPrint {
create_at datetime
update_at datetime
}
class TableHistory {
delete_at datetime
delete_by datetime
}
class TableX inherit TableFootPrint {
id int
name string
.....
}
class TableXHistory inherit TableX,TableHistory {
}
class SimpleTableY {
id int
name string
.....
}
class SimpleTableYHistory inherit TableHistory {
id int
name string
.....
}
但是如果单继承的话,似乎要重复手打 TableHistory 的属性
如果在 ES6 中,可以用展开符...baseObj来实现重复属性的引入
但 C# 中没有展开符语法糖。。。。。。不知道 JAVA 有没有,但估计也没有。
问下单继承中如何实现上述逻辑?