Madhawa Learns To Blog

.net, c#, sql, OOAD and more mad memory dumps...

Tuesday, March 15, 2005

msn chat with Mahasen on MI

After reading first post of my blog my friend Sohona (mahasen.blogspot.com) and me had a chat on MI.
Here I've pasted it. Think it was a usefull one and may be usefull to u also, right........

Mahasen says:
golden rule of OOP
Mahasen says:
prefer aggrigation over inheritance for code reuse
Mahasen says:
umbata multiple inheritance mimic karanta puluwan c# wala (.net wala) lesiyenma
Ðŕ Ðŕє™ says:
and if they include mi in c# they cant do type safe no
Ðŕ Ðŕє™ says:
thx
Mahasen says:
well.. yes
Mahasen says:
that's not always
Ðŕ Ðŕє™ says:
y?
Mahasen says:
it's only if the base types contain same type members
Ðŕ Ðŕє™ says:
explain me pls
Mahasen says:
if the base classes are completely indipendant
Mahasen says:
the derived is type safe
Mahasen says:
well lets say
Mahasen says:
we have 2 classes
Ðŕ Ðŕє™ says:
yep
Mahasen says:
one tree
Mahasen says:
with Color and height properties
Mahasen says:
and Grow method
Ðŕ Ðŕє™ says:
mmm
Mahasen says:
and another "Somename", with Width and and weight properties
Mahasen says:
and some method
Mahasen says:
so these two classes
Mahasen says:
has completly diferant typefaces
Ðŕ Ðŕє™ says:
yep
Mahasen says:
and their protected members probably differ with names
Ðŕ Ðŕє™ says:
mmm
Mahasen says:
so if a class mi these two classes
Mahasen says:
that class is type safe
Mahasen says:
and could be used inplace of both the above classes
Mahasen says:
no problem
Ðŕ Ðŕє™ says:
interesting point thx
Mahasen says:
but
Mahasen says:
say if the type of the two classes overlap
Mahasen says:
in that case
Ðŕ Ðŕє™ says:
mmm
Mahasen says:
the which classes member does the derived class implement
Mahasen says:
or represent?
Mahasen says:
so could the derived class represent the base class which it doesn't implement the member
Mahasen says:
?
Mahasen says:
then
Mahasen says:
it's not type safe
Mahasen says:
c++ supports MI
Mahasen says:
as long as u use MI with care
Mahasen says:
and good understanding
Mahasen says:
u could use it with typesafty
Mahasen says:
but it's very easy to slip away
Ðŕ Ðŕє™ says:
yes i got it
Ðŕ Ðŕє™ says:
thx
Ðŕ Ðŕє™ says:
so c++.net got mi?
Mahasen says:
np
Mahasen says:
yes
Mahasen says:
outside managed scope
Ðŕ Ðŕє™ says:
i thought that y asked u
Mahasen says:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home