作者tinlans ( )
看板Programming
标题Re: 继承和多重继承
时间Thu Jul 16 16:59:44 2009
※ 引述《sorryChen (陈扬和)》之铭言:
: 为了使我的code更清晰明了, 我使用继承 (主要并不是为了重复使用)
: ex: 跑车 继承 车 继承 交通工具
: 现在因为功能问题 需要改成
: 车 继承 交通工具
: 船 继承 交通工具
: 水陆两用车 继承 车 继承船... 这样行吗 这样定义的variable就重复了..
: 这要怎麽改呢
其实我比较好奇的是,
「交通工具」这种分类有什麽共通特性和介面值得你把它抽出来?
要不要考虑拿掉这个 class?
--
Ling-hua Tseng (
[email protected])
Department of Computer Science, National Tsing-Hua University
Interesting: C++, Compiler, PL/PD, OS, VM, Large-scale software design
Researching: Software pipelining for VLIW architectures
Homepage:
https://www.tinlans.org
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.160.105.128
1F:推 march20:我猜在他在"交通工具" 实作了某些 util 66.75.255.220 07/16 18:26