Derived classes or functions.

  • Thread starter Thread starter David E
  • Start date Start date
D

David E

Hi,

I was hoping for a little advice about the following.

Firstly can I use multiple inheritance in vb.net. For example can I have my
webform class derive from mulpitle classes, and if so what is the syntax, I
can derive from a single class (inherit) but not from more than one.

secondly

I have certain functions that need to be in every page of this site
I am developing. so is the best approach to simply put them all into a class
and derive from it,
(perhaps not the strongest design) or to #include a file with all the
functions in in every page.

The main reason I ask is that I am starting to learn asp.net after
spending many years in classic asp. I was under the impressoion that
#including in asp.net was felt to be "not so good" and deriving from a class
that has no direct relation to the new class (in this case the page) was not
good design.

or is there another way that I should be approachng this ie web controls,
user controls ect...

any help is appreciated.

thanks in advance.

cheers

david
 
David Hi,

1) CLR dont support multiple inheritance, thus every development
language.

2) The best practice for your situation is static / shared function that
can be call from every page without creating objects.

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
Thanks for the reply.

Is the lack of multiple inheritance in the clr not a short coming.

does this mean that this is not supported in C++ managed extensions, because
multiple inheritance is supported in C++/Visual C++.
Is it not a backward step to take it awy from that particular language (or
it's "extended version.")

cheers

martin.
 
Hi,

Managed code does not support:
multiple inheritance, operator overloading, copy constructors, operator=
syntax (e.g. +=, -=, *=, etc.),
friendship (i.e. you cannot use the friend keyword in managed C++).

I just can tell you what I think about it. I don't see it as a draw back
for two reasons 1) IL and CLR aim is to enable different languages and
development tool to generate code that can be use by other languages and
development tools on different operating systems. Althogh sometime
multiple inheritance is missing while working with C#, VB etc. we must
admit that multiple inheritance add level of complexly into programs. 2)
Managed and unmanaged can communicate easily on C++ program. you can use
multiple inheritance in unmanaged classes and call them from managed
classes.

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
Back
Top