Re: Good COM Interface Design
With derivation you lose the capability of extending the base interface.
However, that does not necessarily mean it's a bad option. A properly
designed base interface doesn't ever need to be extended. Case in
point: IPersist. From practical perspective, it more often makes sense
not to derive an interface from another. However, I want to stress
there's no one hard and fast rule for all occasions. E.g. independent
interfaces are _not_ superior to derived interfaces.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"anand" <anand.chugh@gmail.com> wrote in message
news:1176827144.235454.322150@l77g2000hsb.googlegroups.com...
On Apr 17, 7:57 pm, "catharticmomentuse...@yahoo.co.uk"
<catharticmomentuse...@yahoo.co.uk> wrote:
It depends a lot on the problem you are trying to solve.
What are the interfaces trying to achieve? If there an "Is-a"
relationship then inheritance maybe a good solution.
Would it be reasonable to have a client that implemented the methods
of A2 without implementing A? If so then you shouldn't use inheritance
(since any implementation of A2 would be forced to include all the
methods from A).
Yeah that depends on lots of stuff, but what would be good design
approach to make components extensible for future??