zyzhang
Explorer
发贴: 155
积分: 30
|
于 2003-11-03 23:06
It's said in OO Principles that favorite composite,instead of inheritance.
I have problme on implementating it.Suppose, I have three classes a,b,c.a is supper class of b and c , and there are few difference between b and c.Using composite, i put reference to a in b and c, but for every methods in a ,i have to recreate them in b and c(just calling a's corresponding methods), this is tedious work, even though i can get some benefit from the composite.
Is there any comments on it.
|