摘要
委托和继承机制是面向对象设计中 2种最常用的复用手段 ,但是由于某些设计师没有完全弄清楚它们之间的关系和各自的应用场合 ,导致在软件界经常可以看到它们被滥用于设计中。为了纠正这种错误 ,先从它们的基本概念入手 ,详细地比较了它们之间的区别及各自的应用场合 ,然后用一个实例说明了它们在设计中的用法及注意事项。
Delegation and inheritance are two effective reuse mechanisms in Object-oriented software development. However, some defective software designs, which abuse them, can often be seen as the designers can not fully understand the differences between their relationship and their applicable scenarios. To improve this situation, the article firstly introduced their definitions, differences and summed up their applied areas and then illustrated an example for their usages and notices in program’s design.
出处
《武汉理工大学学报》
CAS
CSCD
2004年第8期77-79,89,共4页
Journal of Wuhan University of Technology
关键词
委托
继承
设计模式
delegation
inheritance
design pattern