473,396 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Interfaces, Big Deal!!

Hi,

Please help me to understand this, because I don't see what I'm missing.

I was reading a lot of examples on Internet that explain that C# doesn't
implement multiple inheritance it implement multiple interfaces.

So, I keep reading and reading and reading to see how can I resolve my
problem with interfaces.

The conclusion is I'm writing to all of you because I couldn't find the way
to resolve my problem.

If I can create multiples interfaces and I have to implement the methods on
the derived class, then what's the big deal.

I know if I declare a class that inherit from one interface is useful
because for example

I can create an Interface called Shape, and 3 Classes called Circle,
Rectangle, and Line.

If on my interface I declare my method Draw(); and I implement on each
derived class then I could do the next.

IShape s = (IShape) AnyShapeObject;

s.draw();

I think is very useful and I used many times. But now the question is what
is the similitude between Multiple Inheritance and Multiple Interfaces???? I
don't see too much

Why on Internet always speak for Multiple Inheritance and Multiple
Interfaces like they have a relation???

My Case:

I have many Windows Control and I'm inherit each one for create my own
Controls.

For example I want to add method called getVirtualSize();

I create and interface

IVirtualSize

It contain

public getVirtualSize();

So, on my derived class I MUST implement my method getVirtualSize and that's
it.

Very nice!!!

Now the real question is, I create a lot of logic on my paint method; this
logic is exactly the same for all derived classes, why do I have to
implement this entire logic on each Control???

With multiple inheritances you just create a class
ExtendedControlFuncionality and Implement a method OnPaintEx, and really I
have a nice source code, because my class ExtendedControlFuncionality has
all the new extended functionality.

Then how can I do the same with interfaces????

I don't want to put my piece of code on every derived class, it is a mess
and very difficult to maintain, I want to centralize my source code and in
the same time I want to use many methods of the base classes, that means I
want to use all the protected methods that the controls offer to me because
OnPaintEx needs those.

Really, here is only one example, the reality is that is a lot of source
code that I "should" implement on every Control, I don't want to do that.

Thanks, the answers will be really appreciated.

Gustavo.


Nov 22 '05 #1
21 936
Hello

Unlike C++, C# doesn't support multiple implementaion inheritance. But your
problem can be solved by deriving the class ExtendedControlFuncionality from
Control and deriving your class from ExtendedControlFuncionality.

Best regards,

Sherif
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:#h**************@tk2msftngp13.phx.gbl...
Hi,

Please help me to understand this, because I don't see what I'm missing.

I was reading a lot of examples on Internet that explain that C# doesn't
implement multiple inheritance it implement multiple interfaces.

So, I keep reading and reading and reading to see how can I resolve my
problem with interfaces.

The conclusion is I'm writing to all of you because I couldn't find the way to resolve my problem.

If I can create multiples interfaces and I have to implement the methods on the derived class, then what's the big deal.

I know if I declare a class that inherit from one interface is useful
because for example

I can create an Interface called Shape, and 3 Classes called Circle,
Rectangle, and Line.

If on my interface I declare my method Draw(); and I implement on each
derived class then I could do the next.

IShape s = (IShape) AnyShapeObject;

s.draw();

I think is very useful and I used many times. But now the question is what
is the similitude between Multiple Inheritance and Multiple Interfaces???? I don't see too much

Why on Internet always speak for Multiple Inheritance and Multiple
Interfaces like they have a relation???

My Case:

I have many Windows Control and I'm inherit each one for create my own
Controls.

For example I want to add method called getVirtualSize();

I create and interface

IVirtualSize

It contain

public getVirtualSize();

So, on my derived class I MUST implement my method getVirtualSize and that's it.

Very nice!!!

Now the real question is, I create a lot of logic on my paint method; this
logic is exactly the same for all derived classes, why do I have to
implement this entire logic on each Control???

With multiple inheritances you just create a class
ExtendedControlFuncionality and Implement a method OnPaintEx, and really I
have a nice source code, because my class ExtendedControlFuncionality has
all the new extended functionality.

Then how can I do the same with interfaces????

I don't want to put my piece of code on every derived class, it is a mess
and very difficult to maintain, I want to centralize my source code and in
the same time I want to use many methods of the base classes, that means I
want to use all the protected methods that the controls offer to me because OnPaintEx needs those.

Really, here is only one example, the reality is that is a lot of source
code that I "should" implement on every Control, I don't want to do that.

Thanks, the answers will be really appreciated.

Gustavo.

Nov 22 '05 #2
But Control doesn't do anything that I want.

Basically, I want derive from Label, Panel, GroupBox, CheckBox, RadioButton,
etc. and add my extended funcionalities

The Class control doesn't have any funcionality.

On that case if I derived from Control I have to rewrite each windows
control from scratch wich is "not possible", doesn't make sense.

Thanks,
Gustavo.

"Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello

Unlike C++, C# doesn't support multiple implementaion inheritance. But your problem can be solved by deriving the class ExtendedControlFuncionality from Control and deriving your class from ExtendedControlFuncionality.

Best regards,

Sherif
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:#h**************@tk2msftngp13.phx.gbl...
Hi,

Please help me to understand this, because I don't see what I'm missing.

I was reading a lot of examples on Internet that explain that C# doesn't
implement multiple inheritance it implement multiple interfaces.

So, I keep reading and reading and reading to see how can I resolve my
problem with interfaces.

The conclusion is I'm writing to all of you because I couldn't find the way
to resolve my problem.

If I can create multiples interfaces and I have to implement the methods

on
the derived class, then what's the big deal.

I know if I declare a class that inherit from one interface is useful
because for example

I can create an Interface called Shape, and 3 Classes called Circle,
Rectangle, and Line.

If on my interface I declare my method Draw(); and I implement on each
derived class then I could do the next.

IShape s = (IShape) AnyShapeObject;

s.draw();

I think is very useful and I used many times. But now the question is what is the similitude between Multiple Inheritance and Multiple Interfaces???? I
don't see too much

Why on Internet always speak for Multiple Inheritance and Multiple
Interfaces like they have a relation???

My Case:

I have many Windows Control and I'm inherit each one for create my own
Controls.

For example I want to add method called getVirtualSize();

I create and interface

IVirtualSize

It contain

public getVirtualSize();

So, on my derived class I MUST implement my method getVirtualSize and

that's
it.

Very nice!!!

Now the real question is, I create a lot of logic on my paint method;

this logic is exactly the same for all derived classes, why do I have to
implement this entire logic on each Control???

With multiple inheritances you just create a class
ExtendedControlFuncionality and Implement a method OnPaintEx, and really I have a nice source code, because my class ExtendedControlFuncionality has all the new extended functionality.

Then how can I do the same with interfaces????

I don't want to put my piece of code on every derived class, it is a mess and very difficult to maintain, I want to centralize my source code and in the same time I want to use many methods of the base classes, that means I want to use all the protected methods that the controls offer to me

because
OnPaintEx needs those.

Really, here is only one example, the reality is that is a lot of source
code that I "should" implement on every Control, I don't want to do that.
Thanks, the answers will be really appreciated.

Gustavo.


Nov 22 '05 #3
So just have a class that has private members of all those types. Inheriting
from all of the GUI classes does not make sense as they are all functionally
different.

Kieran

"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
But Control doesn't do anything that I want.

Basically, I want derive from Label, Panel, GroupBox, CheckBox, RadioButton, etc. and add my extended funcionalities

The Class control doesn't have any funcionality.

On that case if I derived from Control I have to rewrite each windows
control from scratch wich is "not possible", doesn't make sense.

Thanks,
Gustavo.

"Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello

Unlike C++, C# doesn't support multiple implementaion inheritance. But your
problem can be solved by deriving the class ExtendedControlFuncionality

from
Control and deriving your class from ExtendedControlFuncionality.

Best regards,

Sherif
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:#h**************@tk2msftngp13.phx.gbl...
Hi,

Please help me to understand this, because I don't see what I'm missing.
I was reading a lot of examples on Internet that explain that C# doesn't implement multiple inheritance it implement multiple interfaces.

So, I keep reading and reading and reading to see how can I resolve my
problem with interfaces.

The conclusion is I'm writing to all of you because I couldn't find the
way
to resolve my problem.

If I can create multiples interfaces and I have to implement the
methods
on
the derived class, then what's the big deal.

I know if I declare a class that inherit from one interface is useful
because for example

I can create an Interface called Shape, and 3 Classes called Circle,
Rectangle, and Line.

If on my interface I declare my method Draw(); and I implement on each
derived class then I could do the next.

IShape s = (IShape) AnyShapeObject;

s.draw();

I think is very useful and I used many times. But now the question is

what is the similitude between Multiple Inheritance and Multiple Interfaces????
I
don't see too much

Why on Internet always speak for Multiple Inheritance and Multiple
Interfaces like they have a relation???

My Case:

I have many Windows Control and I'm inherit each one for create my own
Controls.

For example I want to add method called getVirtualSize();

I create and interface

IVirtualSize

It contain

public getVirtualSize();

So, on my derived class I MUST implement my method getVirtualSize and

that's
it.

Very nice!!!

Now the real question is, I create a lot of logic on my paint method;

this logic is exactly the same for all derived classes, why do I have to
implement this entire logic on each Control???

With multiple inheritances you just create a class
ExtendedControlFuncionality and Implement a method OnPaintEx, and
really I have a nice source code, because my class ExtendedControlFuncionality has all the new extended functionality.

Then how can I do the same with interfaces????

I don't want to put my piece of code on every derived class, it is a mess and very difficult to maintain, I want to centralize my source code
and
in the same time I want to use many methods of the base classes, that
means
I want to use all the protected methods that the controls offer to me

because
OnPaintEx needs those.

Really, here is only one example, the reality is that is a lot of
source code that I "should" implement on every Control, I don't want to do

that.
Thanks, the answers will be really appreciated.

Gustavo.



Nov 22 '05 #4
Can you implement the logic into a function (if VB) or static method in a
class (VB or C#). Then for a control, implement your new interface and in
the method of the implemented interface just pass the call onto the function
or shared method?

"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
But Control doesn't do anything that I want.

Basically, I want derive from Label, Panel, GroupBox, CheckBox, RadioButton, etc. and add my extended funcionalities

The Class control doesn't have any funcionality.

On that case if I derived from Control I have to rewrite each windows
control from scratch wich is "not possible", doesn't make sense.

Thanks,
Gustavo.

"Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello

Unlike C++, C# doesn't support multiple implementaion inheritance. But your
problem can be solved by deriving the class ExtendedControlFuncionality

from
Control and deriving your class from ExtendedControlFuncionality.

Best regards,

Sherif
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:#h**************@tk2msftngp13.phx.gbl...
Hi,

Please help me to understand this, because I don't see what I'm missing.
I was reading a lot of examples on Internet that explain that C# doesn't implement multiple inheritance it implement multiple interfaces.

So, I keep reading and reading and reading to see how can I resolve my
problem with interfaces.

The conclusion is I'm writing to all of you because I couldn't find the
way
to resolve my problem.

If I can create multiples interfaces and I have to implement the
methods
on
the derived class, then what's the big deal.

I know if I declare a class that inherit from one interface is useful
because for example

I can create an Interface called Shape, and 3 Classes called Circle,
Rectangle, and Line.

If on my interface I declare my method Draw(); and I implement on each
derived class then I could do the next.

IShape s = (IShape) AnyShapeObject;

s.draw();

I think is very useful and I used many times. But now the question is

what is the similitude between Multiple Inheritance and Multiple Interfaces????
I
don't see too much

Why on Internet always speak for Multiple Inheritance and Multiple
Interfaces like they have a relation???

My Case:

I have many Windows Control and I'm inherit each one for create my own
Controls.

For example I want to add method called getVirtualSize();

I create and interface

IVirtualSize

It contain

public getVirtualSize();

So, on my derived class I MUST implement my method getVirtualSize and

that's
it.

Very nice!!!

Now the real question is, I create a lot of logic on my paint method;

this logic is exactly the same for all derived classes, why do I have to
implement this entire logic on each Control???

With multiple inheritances you just create a class
ExtendedControlFuncionality and Implement a method OnPaintEx, and
really I have a nice source code, because my class ExtendedControlFuncionality has all the new extended functionality.

Then how can I do the same with interfaces????

I don't want to put my piece of code on every derived class, it is a mess and very difficult to maintain, I want to centralize my source code
and
in the same time I want to use many methods of the base classes, that
means
I want to use all the protected methods that the controls offer to me

because
OnPaintEx needs those.

Really, here is only one example, the reality is that is a lot of
source code that I "should" implement on every Control, I don't want to do

that.
Thanks, the answers will be really appreciated.

Gustavo.



Nov 22 '05 #5
Hi Kieran,

|| So just have a class that has private members of all those types.

I'm not sure how that would work.

|| Inheriting from all of the GUI classes does not make sense as
|| they are all functionally different.

That's exactly the point - disparate objects but which require a <common
Capability>. Franco would have a FrancoLabel which would inherit from Label
and CapCtrlExtensions, and a FrancoPanel - Panel and CapCtrlExtensions, etc,
etc.

Using the interface approach means that the code has to be duplicated in
each of the ingheriting classes. Using multiple inheritance means bolting the
Capability on. Write once, re-use - it's what OOP shouts from the rooftops.

Regards,
Fergus
Nov 22 '05 #6
Yep, I tried that, but if you pass the control to a function on different
class (static or not static) then you can't get access to the protected
methods from the control.

Basically, My application is skinned, and I needed "true" transparent
controls.

Windows Problem

1) On Many controls you can't set Background like transparent,
(Color.Transparent)

2) Controls like GroupBox they capture the background wrong (if you have a
gradient background on the parent windows and the GroupBox is on the
position 50,50 then the background is capture from the Parent from the
position 0,0 which is wrong, because the GroupBox doesn't looks like
transparent in at all, has the gradient translated)

3) On the Controls that accept Color.Transparent, if you have a control on
Color.Transparent color and there is another control behind it (is not child
or parent, they have the same parent), Windows just capture the parent
Background which is wrong again, because you can't see the control that is
behind him.

So, what I did is inherit every control of windows, create my own BackBuffer
where I keep all my window status and changes, avoid call to
OnPaintBackground, and I take the process to draw the portion that windows
ask me to redraw with my own BackBuffer.

So, All this process is standard for every control and work really good,
then I can get "true" transparency and you don't see the difference on
performance.

But the code is ugly, because I have the same method implementation like 10
times!!!

Then the only that I need is consolidate my functionality on just one single
Class, Interface, Method or whatever I need.

On C++ if you do multi-inheritance then I can get what I'm looking for.

So, there is some way to emulate multi-inheritance on C#?????

I though interface was the answer. I see may be interface can't do too much
here, then some idea???

Thanks,

Gustavo.

P.S.: I think this is a very commun problem where you have to add
funcionality to thirdparty classes where you have to inherit from each one
of them and you have to share code for all of them.

"Anon" <An**@Anon.Anon> wrote in message
news:7t********************@rwcrnsc51.ops.asp.att. net...
Can you implement the logic into a function (if VB) or static method in a
class (VB or C#). Then for a control, implement your new interface and in
the method of the implemented interface just pass the call onto the function or shared method?

"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
But Control doesn't do anything that I want.

Basically, I want derive from Label, Panel, GroupBox, CheckBox,

RadioButton,
etc. and add my extended funcionalities

The Class control doesn't have any funcionality.

On that case if I derived from Control I have to rewrite each windows
control from scratch wich is "not possible", doesn't make sense.

Thanks,
Gustavo.

"Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello

Unlike C++, C# doesn't support multiple implementaion inheritance. But

your
problem can be solved by deriving the class ExtendedControlFuncionality
from
Control and deriving your class from ExtendedControlFuncionality.

Best regards,

Sherif
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:#h**************@tk2msftngp13.phx.gbl...
> Hi,
>
>
>
> Please help me to understand this, because I don't see what I'm missing. >
>
>
> I was reading a lot of examples on Internet that explain that C# doesn't > implement multiple inheritance it implement multiple interfaces.
>
>
>
> So, I keep reading and reading and reading to see how can I resolve
my > problem with interfaces.
>
> The conclusion is I'm writing to all of you because I couldn't find the way
> to resolve my problem.
>
>
>
> If I can create multiples interfaces and I have to implement the methods on
> the derived class, then what's the big deal.
>
>
>
> I know if I declare a class that inherit from one interface is useful > because for example
>
> I can create an Interface called Shape, and 3 Classes called Circle,
> Rectangle, and Line.
>
> If on my interface I declare my method Draw(); and I implement on each > derived class then I could do the next.
>
>
>
> IShape s = (IShape) AnyShapeObject;
>
> s.draw();
>
>
>
> I think is very useful and I used many times. But now the question is what
> is the similitude between Multiple Inheritance and Multiple

Interfaces????
I
> don't see too much
>
>
>
> Why on Internet always speak for Multiple Inheritance and Multiple
> Interfaces like they have a relation???
>
>
>
> My Case:
>
>
>
> I have many Windows Control and I'm inherit each one for create my
own > Controls.
>
> For example I want to add method called getVirtualSize();
>
>
>
> I create and interface
>
> IVirtualSize
>
>
>
> It contain
>
> public getVirtualSize();
>
>
>
> So, on my derived class I MUST implement my method getVirtualSize and that's
> it.
>
>
>
> Very nice!!!
>
>
>
> Now the real question is, I create a lot of logic on my paint
method; this
> logic is exactly the same for all derived classes, why do I have to
> implement this entire logic on each Control???
>
>
>
> With multiple inheritances you just create a class
> ExtendedControlFuncionality and Implement a method OnPaintEx, and really
I
> have a nice source code, because my class

ExtendedControlFuncionality has
> all the new extended functionality.
>
>
>
> Then how can I do the same with interfaces????
>
>
>
> I don't want to put my piece of code on every derived class, it is a

mess
> and very difficult to maintain, I want to centralize my source code

and
in
> the same time I want to use many methods of the base classes, that

means
I
> want to use all the protected methods that the controls offer to me
because
> OnPaintEx needs those.
>
>
>
> Really, here is only one example, the reality is that is a lot of

source > code that I "should" implement on every Control, I don't want to do

that.
>
>
>
> Thanks, the answers will be really appreciated.
>
> Gustavo.
>
>
>
>



Nov 22 '05 #7
Hi Anon,

In this instance, the problem with off-loading the functionality to
another Class or Module and passing the target object in, is that it would not
have access to the target's protected and/or private members.

In any case, that is just one example that frustrates Franco - as a
general solution there would be many cases where it's a workable but messy.

In my main response to Franco, I mention a linked-list Capability that I
have had to implement using an Interface. This does actually work by sending
the object to a worker Class to traverse the list. The method works, but it
suffers because I have to make the actual link fields, Prev and Next, public,
as my worker needs access to them. There are also issues with casting and
type-safety. I can't prevent a programmer from inserting a Widget into a
linked list of Thingies. As I'm the programmer, that's not going to happen,
but I would prefer to have my carpets tacked down rather than watch my feet.

Regards,
Fergus
Nov 22 '05 #8
Hi Franco,

I'm entirely in agreement with you on this issue. Yes, Interfaces have
their (many) uses. But so does multiple inheritance.

My case in point - I create many objects with a totally different nature.
But I want them all to be capable of being in a linked list. I don't want to
have to create a separate class to manage these links. I don't want a
collection or an ArrayList. I simply want a Next and a Prev and a couple of
other trivial bits.

I'd like to define a small linked-list Capability class which I bolt-on to
my other classes through multiple inheritance.

But I can't. :-((

My only recourse is to define an interface, CapLinkable, and <copy> the
code (it's perfectly generic - needs not even a single character to be
changed) into <every> class that is to have this Capability. [I only have this
in C# because I can do it in about 15 lines - in VB it would probably be about
75!!]

But it's a maintenance nightmare, for I cannot even do it with <include>
files - it has to be a textual copy each time!!

There are many small pieces of functionality that would work for many,
many disparate objects without code change required - or in your case, minimal
changes.

Another example is the ability to Serialise. This could be done through
the inheritance of Capabilities. But no, it has to be done by setting an
Attribute and having the serialization done behind the scenes as a fiddle by
the Attribute in conjunction with a Formatter. Why can't an object serialise
<itself> by inheriting from a CapSerializable Capability?

It would be very useful if there were a mechanism for bolting these
Capabilities onto a class without having to reimplement the wheel each time.

Regards,
Fergus
Nov 22 '05 #9
Franco,
As Sherif stated, .NET does not have Multiple Implementation Inheritance,
one common method to get around this is to have an Implementation class
along with your interface. You would have an IShape interface along with a
ShapeImpl implementation class. Your Circle class would implement the IShape
interface, then contain a ShapeImpl object as a field, the IShape method
would delegate to the ShapeImple class. NOTE, Circle would NOT inherit from
ShapeImpl.

Have you considered using creating an Extender Provider class instead?

An Extender Provider is a class (can be either a Component or a Control)
that implements the System.ComponentModel.IExtenderProvider interface
allowing you to add new properties to controls. Along with these properties
you can attach event handlers to the targeted controls enabling you at add
functionality.

http://msdn.microsoft.com/library/de...derobjects.asp

http://msdn.microsoft.com/library/de...erprovider.asp

http://msdn.microsoft.com/library/de...idersample.asp

Hope this helps
Jay
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
But Control doesn't do anything that I want.

Basically, I want derive from Label, Panel, GroupBox, CheckBox, RadioButton, etc. and add my extended funcionalities

The Class control doesn't have any funcionality.

On that case if I derived from Control I have to rewrite each windows
control from scratch wich is "not possible", doesn't make sense.

Thanks,
Gustavo.

"Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello

Unlike C++, C# doesn't support multiple implementaion inheritance. But your
problem can be solved by deriving the class ExtendedControlFuncionality

from
Control and deriving your class from ExtendedControlFuncionality.

Best regards,

Sherif
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:#h**************@tk2msftngp13.phx.gbl...
Hi,

Please help me to understand this, because I don't see what I'm missing.
I was reading a lot of examples on Internet that explain that C# doesn't implement multiple inheritance it implement multiple interfaces.

So, I keep reading and reading and reading to see how can I resolve my
problem with interfaces.

The conclusion is I'm writing to all of you because I couldn't find the
way
to resolve my problem.

If I can create multiples interfaces and I have to implement the
methods
on
the derived class, then what's the big deal.

I know if I declare a class that inherit from one interface is useful
because for example

I can create an Interface called Shape, and 3 Classes called Circle,
Rectangle, and Line.

If on my interface I declare my method Draw(); and I implement on each
derived class then I could do the next.

IShape s = (IShape) AnyShapeObject;

s.draw();

I think is very useful and I used many times. But now the question is

what is the similitude between Multiple Inheritance and Multiple Interfaces????
I
don't see too much

Why on Internet always speak for Multiple Inheritance and Multiple
Interfaces like they have a relation???

My Case:

I have many Windows Control and I'm inherit each one for create my own
Controls.

For example I want to add method called getVirtualSize();

I create and interface

IVirtualSize

It contain

public getVirtualSize();

So, on my derived class I MUST implement my method getVirtualSize and

that's
it.

Very nice!!!

Now the real question is, I create a lot of logic on my paint method;

this logic is exactly the same for all derived classes, why do I have to
implement this entire logic on each Control???

With multiple inheritances you just create a class
ExtendedControlFuncionality and Implement a method OnPaintEx, and
really I have a nice source code, because my class ExtendedControlFuncionality has all the new extended functionality.

Then how can I do the same with interfaces????

I don't want to put my piece of code on every derived class, it is a mess and very difficult to maintain, I want to centralize my source code
and
in the same time I want to use many methods of the base classes, that
means
I want to use all the protected methods that the controls offer to me

because
OnPaintEx needs those.

Really, here is only one example, the reality is that is a lot of
source code that I "should" implement on every Control, I don't want to do

that.
Thanks, the answers will be really appreciated.

Gustavo.



Nov 22 '05 #10
Exactly, You know perfect what I'm talking about.

In fact on my example all the base classes have a class in common,

"Control", and that is exactly what I need to change because all the OnPaint
and OnPaintBackground are coming from Control Object.

So is not crazy the idea that if I have Label, Panel, and GroupBox coming
from a common class "Control" have the possibilities to change the behavior
of the Base class.

And having this functionality still I think is good OOP

Thanks,

Gustavo.

"Fergus Cooney" <fi******@tesco.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Franco,

I'm entirely in agreement with you on this issue. Yes, Interfaces have
their (many) uses. But so does multiple inheritance.

My case in point - I create many objects with a totally different nature. But I want them all to be capable of being in a linked list. I don't want to have to create a separate class to manage these links. I don't want a
collection or an ArrayList. I simply want a Next and a Prev and a couple of other trivial bits.

I'd like to define a small linked-list Capability class which I bolt-on to my other classes through multiple inheritance.

But I can't. :-((

My only recourse is to define an interface, CapLinkable, and <copy> the code (it's perfectly generic - needs not even a single character to be
changed) into <every> class that is to have this Capability. [I only have this in C# because I can do it in about 15 lines - in VB it would probably be about 75!!]

But it's a maintenance nightmare, for I cannot even do it with <include> files - it has to be a textual copy each time!!

There are many small pieces of functionality that would work for many,
many disparate objects without code change required - or in your case, minimal changes.

Another example is the ability to Serialise. This could be done through the inheritance of Capabilities. But no, it has to be done by setting an
Attribute and having the serialization done behind the scenes as a fiddle by the Attribute in conjunction with a Formatter. Why can't an object serialise <itself> by inheriting from a CapSerializable Capability?

It would be very useful if there were a mechanism for bolting these
Capabilities onto a class without having to reimplement the wheel each time.
Regards,
Fergus

Nov 22 '05 #11
I 100% agree Jay B. Harlow, It's my solution either.

let's speak about your transparency problem now, you have 2 things to set
(not one)
1. a transparent background color
2. SetStyle() there is a transparent flag.

now if you have a top panel which is transparent, and use .NET 1.1 all your
child control would be correctly transparent.

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> a écrit dans le
message de news:u2*************@TK2MSFTNGP10.phx.gbl...
Franco,
As Sherif stated, .NET does not have Multiple Implementation Inheritance,
one common method to get around this is to have an Implementation class
along with your interface. You would have an IShape interface along with a
ShapeImpl implementation class. Your Circle class would implement the IShape interface, then contain a ShapeImpl object as a field, the IShape method
would delegate to the ShapeImple class. NOTE, Circle would NOT inherit from ShapeImpl.

Have you considered using creating an Extender Provider class instead?

An Extender Provider is a class (can be either a Component or a Control)
that implements the System.ComponentModel.IExtenderProvider interface
allowing you to add new properties to controls. Along with these properties you can attach event handlers to the targeted controls enabling you at add
functionality.

http://msdn.microsoft.com/library/de...derobjects.asp
http://msdn.microsoft.com/library/de...erprovider.asp
http://msdn.microsoft.com/library/de...idersample.asp
Hope this helps
Jay
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
But Control doesn't do anything that I want.

Basically, I want derive from Label, Panel, GroupBox, CheckBox,

RadioButton,
etc. and add my extended funcionalities

The Class control doesn't have any funcionality.

On that case if I derived from Control I have to rewrite each windows
control from scratch wich is "not possible", doesn't make sense.

Thanks,
Gustavo.

"Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello

Unlike C++, C# doesn't support multiple implementaion inheritance. But

your
problem can be solved by deriving the class ExtendedControlFuncionality
from
Control and deriving your class from ExtendedControlFuncionality.

Best regards,

Sherif
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:#h**************@tk2msftngp13.phx.gbl...
> Hi,
>
>
>
> Please help me to understand this, because I don't see what I'm missing. >
>
>
> I was reading a lot of examples on Internet that explain that C# doesn't > implement multiple inheritance it implement multiple interfaces.
>
>
>
> So, I keep reading and reading and reading to see how can I resolve
my > problem with interfaces.
>
> The conclusion is I'm writing to all of you because I couldn't find the way
> to resolve my problem.
>
>
>
> If I can create multiples interfaces and I have to implement the methods on
> the derived class, then what's the big deal.
>
>
>
> I know if I declare a class that inherit from one interface is useful > because for example
>
> I can create an Interface called Shape, and 3 Classes called Circle,
> Rectangle, and Line.
>
> If on my interface I declare my method Draw(); and I implement on each > derived class then I could do the next.
>
>
>
> IShape s = (IShape) AnyShapeObject;
>
> s.draw();
>
>
>
> I think is very useful and I used many times. But now the question is what
> is the similitude between Multiple Inheritance and Multiple

Interfaces????
I
> don't see too much
>
>
>
> Why on Internet always speak for Multiple Inheritance and Multiple
> Interfaces like they have a relation???
>
>
>
> My Case:
>
>
>
> I have many Windows Control and I'm inherit each one for create my
own > Controls.
>
> For example I want to add method called getVirtualSize();
>
>
>
> I create and interface
>
> IVirtualSize
>
>
>
> It contain
>
> public getVirtualSize();
>
>
>
> So, on my derived class I MUST implement my method getVirtualSize and that's
> it.
>
>
>
> Very nice!!!
>
>
>
> Now the real question is, I create a lot of logic on my paint
method; this
> logic is exactly the same for all derived classes, why do I have to
> implement this entire logic on each Control???
>
>
>
> With multiple inheritances you just create a class
> ExtendedControlFuncionality and Implement a method OnPaintEx, and really
I
> have a nice source code, because my class

ExtendedControlFuncionality has
> all the new extended functionality.
>
>
>
> Then how can I do the same with interfaces????
>
>
>
> I don't want to put my piece of code on every derived class, it is a

mess
> and very difficult to maintain, I want to centralize my source code

and
in
> the same time I want to use many methods of the base classes, that

means
I
> want to use all the protected methods that the controls offer to me
because
> OnPaintEx needs those.
>
>
>
> Really, here is only one example, the reality is that is a lot of

source > code that I "should" implement on every Control, I don't want to do

that.
>
>
>
> Thanks, the answers will be really appreciated.
>
> Gustavo.
>
>
>
>



Nov 22 '05 #12
> As Sherif stated, .NET does not have Multiple Implementation Inheritance,
one common method to get around this is to have an Implementation class
along with your interface. You would have an IShape interface along with a
ShapeImpl implementation class. Your Circle class would implement the IShape interface, then contain a ShapeImpl object as a field, the IShape method
would delegate to the ShapeImple class. NOTE, Circle would NOT inherit from ShapeImpl.
Ok, I see, on this case Interface and Implementation are coming on couple
and I have just one implementation for my code.
But still I don't see how ShapeImpl will access to my protected methods and
private variables from Circle because is a object into the Circle object.
Have you considered using creating an Extender Provider class instead?

An Extender Provider is a class (can be either a Component or a Control)
that implements the System.ComponentModel.IExtenderProvider interface
allowing you to add new properties to controls. Along with these properties you can attach event handlers to the targeted controls enabling you at add
functionality.
I didn't know about that and how it works, I'll read that and try a shot.

Thanks very much,
Gustavo.
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:u2*************@TK2MSFTNGP10.phx.gbl... Franco,
As Sherif stated, .NET does not have Multiple Implementation Inheritance,
one common method to get around this is to have an Implementation class
along with your interface. You would have an IShape interface along with a
ShapeImpl implementation class. Your Circle class would implement the IShape interface, then contain a ShapeImpl object as a field, the IShape method
would delegate to the ShapeImple class. NOTE, Circle would NOT inherit from ShapeImpl.

Have you considered using creating an Extender Provider class instead?

An Extender Provider is a class (can be either a Component or a Control)
that implements the System.ComponentModel.IExtenderProvider interface
allowing you to add new properties to controls. Along with these properties you can attach event handlers to the targeted controls enabling you at add
functionality.

http://msdn.microsoft.com/library/de...derobjects.asp
http://msdn.microsoft.com/library/de...erprovider.asp
http://msdn.microsoft.com/library/de...idersample.asp
Hope this helps
Jay
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
But Control doesn't do anything that I want.

Basically, I want derive from Label, Panel, GroupBox, CheckBox,

RadioButton,
etc. and add my extended funcionalities

The Class control doesn't have any funcionality.

On that case if I derived from Control I have to rewrite each windows
control from scratch wich is "not possible", doesn't make sense.

Thanks,
Gustavo.

"Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello

Unlike C++, C# doesn't support multiple implementaion inheritance. But

your
problem can be solved by deriving the class ExtendedControlFuncionality
from
Control and deriving your class from ExtendedControlFuncionality.

Best regards,

Sherif
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:#h**************@tk2msftngp13.phx.gbl...
> Hi,
>
>
>
> Please help me to understand this, because I don't see what I'm missing. >
>
>
> I was reading a lot of examples on Internet that explain that C# doesn't > implement multiple inheritance it implement multiple interfaces.
>
>
>
> So, I keep reading and reading and reading to see how can I resolve
my > problem with interfaces.
>
> The conclusion is I'm writing to all of you because I couldn't find the way
> to resolve my problem.
>
>
>
> If I can create multiples interfaces and I have to implement the methods on
> the derived class, then what's the big deal.
>
>
>
> I know if I declare a class that inherit from one interface is useful > because for example
>
> I can create an Interface called Shape, and 3 Classes called Circle,
> Rectangle, and Line.
>
> If on my interface I declare my method Draw(); and I implement on each > derived class then I could do the next.
>
>
>
> IShape s = (IShape) AnyShapeObject;
>
> s.draw();
>
>
>
> I think is very useful and I used many times. But now the question is what
> is the similitude between Multiple Inheritance and Multiple

Interfaces????
I
> don't see too much
>
>
>
> Why on Internet always speak for Multiple Inheritance and Multiple
> Interfaces like they have a relation???
>
>
>
> My Case:
>
>
>
> I have many Windows Control and I'm inherit each one for create my
own > Controls.
>
> For example I want to add method called getVirtualSize();
>
>
>
> I create and interface
>
> IVirtualSize
>
>
>
> It contain
>
> public getVirtualSize();
>
>
>
> So, on my derived class I MUST implement my method getVirtualSize and that's
> it.
>
>
>
> Very nice!!!
>
>
>
> Now the real question is, I create a lot of logic on my paint
method; this
> logic is exactly the same for all derived classes, why do I have to
> implement this entire logic on each Control???
>
>
>
> With multiple inheritances you just create a class
> ExtendedControlFuncionality and Implement a method OnPaintEx, and really
I
> have a nice source code, because my class

ExtendedControlFuncionality has
> all the new extended functionality.
>
>
>
> Then how can I do the same with interfaces????
>
>
>
> I don't want to put my piece of code on every derived class, it is a

mess
> and very difficult to maintain, I want to centralize my source code

and
in
> the same time I want to use many methods of the base classes, that

means
I
> want to use all the protected methods that the controls offer to me
because
> OnPaintEx needs those.
>
>
>
> Really, here is only one example, the reality is that is a lot of

source > code that I "should" implement on every Control, I don't want to do

that.
>
>
>
> Thanks, the answers will be really appreciated.
>
> Gustavo.
>
>
>
>



Nov 22 '05 #13
Wow, do they fixed??

I'm using 1.0 and I set for my controls

this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.Opaque, true);

And doing all the logic.

So, that means if I use VS2003 wich compile with 1.1 can I :
Create a Form, put a Background Image on the Form
Create a Panel and set Color.Transparency like a child of the Form
Create a Radio button like Child of Panel

And the background for the radio button will be the form Backgorund????????

May you confirm that? if that's true is a excelent news and I'll switch to
VS2003 the soon as possible

Thanks,
Gustavo.

"Lloyd Dupont" <net.galador@ld> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I 100% agree Jay B. Harlow, It's my solution either.

let's speak about your transparency problem now, you have 2 things to set
(not one)
1. a transparent background color
2. SetStyle() there is a transparent flag.

now if you have a top panel which is transparent, and use .NET 1.1 all your child control would be correctly transparent.

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> a écrit dans le
message de news:u2*************@TK2MSFTNGP10.phx.gbl...
Franco,
As Sherif stated, .NET does not have Multiple Implementation Inheritance,
one common method to get around this is to have an Implementation class
along with your interface. You would have an IShape interface along with a ShapeImpl implementation class. Your Circle class would implement the IShape
interface, then contain a ShapeImpl object as a field, the IShape method
would delegate to the ShapeImple class. NOTE, Circle would NOT inherit

from
ShapeImpl.

Have you considered using creating an Extender Provider class instead?

An Extender Provider is a class (can be either a Component or a Control)
that implements the System.ComponentModel.IExtenderProvider interface
allowing you to add new properties to controls. Along with these

properties
you can attach event handlers to the targeted controls enabling you at add functionality.

http://msdn.microsoft.com/library/de...derobjects.asp

http://msdn.microsoft.com/library/de...erprovider.asp

http://msdn.microsoft.com/library/de...idersample.asp

Hope this helps
Jay
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
But Control doesn't do anything that I want.

Basically, I want derive from Label, Panel, GroupBox, CheckBox,

RadioButton,
etc. and add my extended funcionalities

The Class control doesn't have any funcionality.

On that case if I derived from Control I have to rewrite each windows
control from scratch wich is "not possible", doesn't make sense.

Thanks,
Gustavo.

"Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
> Hello
>
> Unlike C++, C# doesn't support multiple implementaion inheritance. But your
> problem can be solved by deriving the class ExtendedControlFuncionality from
> Control and deriving your class from ExtendedControlFuncionality.
>
> Best regards,
>
> Sherif
>
>
> "Franco Gustavo" <gf*****@inuntius.com> wrote in message
> news:#h**************@tk2msftngp13.phx.gbl...
> > Hi,
> >
> >
> >
> > Please help me to understand this, because I don't see what I'm

missing.
> >
> >
> >
> > I was reading a lot of examples on Internet that explain that C#

doesn't
> > implement multiple inheritance it implement multiple interfaces.
> >
> >
> >
> > So, I keep reading and reading and reading to see how can I resolve my
> > problem with interfaces.
> >
> > The conclusion is I'm writing to all of you because I couldn't
find the
> way
> > to resolve my problem.
> >
> >
> >
> > If I can create multiples interfaces and I have to implement the

methods
> on
> > the derived class, then what's the big deal.
> >
> >
> >
> > I know if I declare a class that inherit from one interface is useful > > because for example
> >
> > I can create an Interface called Shape, and 3 Classes called
Circle, > > Rectangle, and Line.
> >
> > If on my interface I declare my method Draw(); and I implement on

each > > derived class then I could do the next.
> >
> >
> >
> > IShape s = (IShape) AnyShapeObject;
> >
> > s.draw();
> >
> >
> >
> > I think is very useful and I used many times. But now the question is what
> > is the similitude between Multiple Inheritance and Multiple
Interfaces????
> I
> > don't see too much
> >
> >
> >
> > Why on Internet always speak for Multiple Inheritance and Multiple
> > Interfaces like they have a relation???
> >
> >
> >
> > My Case:
> >
> >
> >
> > I have many Windows Control and I'm inherit each one for create my own > > Controls.
> >
> > For example I want to add method called getVirtualSize();
> >
> >
> >
> > I create and interface
> >
> > IVirtualSize
> >
> >
> >
> > It contain
> >
> > public getVirtualSize();
> >
> >
> >
> > So, on my derived class I MUST implement my method getVirtualSize and > that's
> > it.
> >
> >
> >
> > Very nice!!!
> >
> >
> >
> > Now the real question is, I create a lot of logic on my paint method; this
> > logic is exactly the same for all derived classes, why do I have to > > implement this entire logic on each Control???
> >
> >
> >
> > With multiple inheritances you just create a class
> > ExtendedControlFuncionality and Implement a method OnPaintEx, and

really
I
> > have a nice source code, because my class ExtendedControlFuncionality has
> > all the new extended functionality.
> >
> >
> >
> > Then how can I do the same with interfaces????
> >
> >
> >
> > I don't want to put my piece of code on every derived class, it is a mess
> > and very difficult to maintain, I want to centralize my source code and
in
> > the same time I want to use many methods of the base classes, that

means
I
> > want to use all the protected methods that the controls offer to

me > because
> > OnPaintEx needs those.
> >
> >
> >
> > Really, here is only one example, the reality is that is a lot of

source
> > code that I "should" implement on every Control, I don't want to do that.
> >
> >
> >
> > Thanks, the answers will be really appreciated.
> >
> > Gustavo.
> >
> >
> >
> >
>
>



Nov 22 '05 #14
Check out the "decorator pattern". That might be what you're looking for
(at least how I interpretted your question)

Rick

Nov 22 '05 #15
Franco,
Ok, I see, on this case Interface and Implementation are coming on couple
and I have just one implementation for my code.
But still I don't see how ShapeImpl will access to my protected methods and private variables from Circle because is a object into the Circle object.
Are the protected methods inherited or added to Circle. If you added them to
Circle should they have been added to ShapeImpl instead?

Are they private variables added to Circle itself, should they have been
added to ShapeImpl instead?

For methods you will need to structure the method such that the
Implementation class (ShapeImpl) will be able to see it. Either via an
interface of Friend.

Alternatively ShapeImpl can have call backs (either delegate fields or full
events) that it uses to call into Circle when it needs information from
Circle.

For variables I would either make them a member of the Implementation class
itself or pass them as parameters when I call into the Implementation class.
Normally I would set it up such that each instance of Circle had its own
ShapeImpl, which means that ShapeImpl can hold per instance variables of
Circle, in which case ShapeImpl would not need to access details of Circle.

Hope this helps
Jay
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:e3**************@tk2msftngp13.phx.gbl...
As Sherif stated, .NET does not have Multiple Implementation Inheritance,
one common method to get around this is to have an Implementation class
along with your interface. You would have an IShape interface along with a ShapeImpl implementation class. Your Circle class would implement the

IShape
interface, then contain a ShapeImpl object as a field, the IShape method
would delegate to the ShapeImple class. NOTE, Circle would NOT inherit

from
ShapeImpl.


Ok, I see, on this case Interface and Implementation are coming on couple
and I have just one implementation for my code.
But still I don't see how ShapeImpl will access to my protected methods

and private variables from Circle because is a object into the Circle object.
Have you considered using creating an Extender Provider class instead?

An Extender Provider is a class (can be either a Component or a Control)
that implements the System.ComponentModel.IExtenderProvider interface
allowing you to add new properties to controls. Along with these properties
you can attach event handlers to the targeted controls enabling you at add functionality.


I didn't know about that and how it works, I'll read that and try a shot.

Thanks very much,
Gustavo.
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in

message news:u2*************@TK2MSFTNGP10.phx.gbl...
Franco,
As Sherif stated, .NET does not have Multiple Implementation Inheritance, one common method to get around this is to have an Implementation class
along with your interface. You would have an IShape interface along with a ShapeImpl implementation class. Your Circle class would implement the IShape
interface, then contain a ShapeImpl object as a field, the IShape method
would delegate to the ShapeImple class. NOTE, Circle would NOT inherit

from
ShapeImpl.

Have you considered using creating an Extender Provider class instead?

An Extender Provider is a class (can be either a Component or a Control)
that implements the System.ComponentModel.IExtenderProvider interface
allowing you to add new properties to controls. Along with these

properties
you can attach event handlers to the targeted controls enabling you at add functionality.

http://msdn.microsoft.com/library/de...derobjects.asp

http://msdn.microsoft.com/library/de...erprovider.asp

http://msdn.microsoft.com/library/de...idersample.asp

Hope this helps
Jay
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
But Control doesn't do anything that I want.

Basically, I want derive from Label, Panel, GroupBox, CheckBox,

RadioButton,
etc. and add my extended funcionalities

The Class control doesn't have any funcionality.

On that case if I derived from Control I have to rewrite each windows
control from scratch wich is "not possible", doesn't make sense.

Thanks,
Gustavo.

"Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
> Hello
>
> Unlike C++, C# doesn't support multiple implementaion inheritance. But your
> problem can be solved by deriving the class ExtendedControlFuncionality from
> Control and deriving your class from ExtendedControlFuncionality.
>
> Best regards,
>
> Sherif
>
>
> "Franco Gustavo" <gf*****@inuntius.com> wrote in message
> news:#h**************@tk2msftngp13.phx.gbl...
> > Hi,
> >
> >
> >
> > Please help me to understand this, because I don't see what I'm

missing.
> >
> >
> >
> > I was reading a lot of examples on Internet that explain that C#

doesn't
> > implement multiple inheritance it implement multiple interfaces.
> >
> >
> >
> > So, I keep reading and reading and reading to see how can I resolve my
> > problem with interfaces.
> >
> > The conclusion is I'm writing to all of you because I couldn't
find the
> way
> > to resolve my problem.
> >
> >
> >
> > If I can create multiples interfaces and I have to implement the

methods
> on
> > the derived class, then what's the big deal.
> >
> >
> >
> > I know if I declare a class that inherit from one interface is useful > > because for example
> >
> > I can create an Interface called Shape, and 3 Classes called
Circle, > > Rectangle, and Line.
> >
> > If on my interface I declare my method Draw(); and I implement on

each > > derived class then I could do the next.
> >
> >
> >
> > IShape s = (IShape) AnyShapeObject;
> >
> > s.draw();
> >
> >
> >
> > I think is very useful and I used many times. But now the question is what
> > is the similitude between Multiple Inheritance and Multiple
Interfaces????
> I
> > don't see too much
> >
> >
> >
> > Why on Internet always speak for Multiple Inheritance and Multiple
> > Interfaces like they have a relation???
> >
> >
> >
> > My Case:
> >
> >
> >
> > I have many Windows Control and I'm inherit each one for create my own > > Controls.
> >
> > For example I want to add method called getVirtualSize();
> >
> >
> >
> > I create and interface
> >
> > IVirtualSize
> >
> >
> >
> > It contain
> >
> > public getVirtualSize();
> >
> >
> >
> > So, on my derived class I MUST implement my method getVirtualSize and > that's
> > it.
> >
> >
> >
> > Very nice!!!
> >
> >
> >
> > Now the real question is, I create a lot of logic on my paint method; this
> > logic is exactly the same for all derived classes, why do I have to > > implement this entire logic on each Control???
> >
> >
> >
> > With multiple inheritances you just create a class
> > ExtendedControlFuncionality and Implement a method OnPaintEx, and

really
I
> > have a nice source code, because my class ExtendedControlFuncionality has
> > all the new extended functionality.
> >
> >
> >
> > Then how can I do the same with interfaces????
> >
> >
> >
> > I don't want to put my piece of code on every derived class, it is a mess
> > and very difficult to maintain, I want to centralize my source code and
in
> > the same time I want to use many methods of the base classes, that

means
I
> > want to use all the protected methods that the controls offer to

me > because
> > OnPaintEx needs those.
> >
> >
> >
> > Really, here is only one example, the reality is that is a lot of

source
> > code that I "should" implement on every Control, I don't want to do that.
> >
> >
> >
> > Thanks, the answers will be really appreciated.
> >
> > Gustavo.
> >
> >
> >
> >
>
>



Nov 22 '05 #16
> Are the protected methods inherited or added to Circle. If you added them
to
Circle should they have been added to ShapeImpl instead?

Are they private variables added to Circle itself, should they have been
added to ShapeImpl instead?
No, they belong to the base class.

I see how to do it with callback functions, is not so messy and can work
fine.

Anyway all those ways are an alternative, is like there are no a clear way
how to do it without insert a trick o working around.

So, Then if multiple inheritance and multiples interfaces implementation "I
see" are really different, why on 95% on the web site speak like they have a
relation?

Thanks very much, and I'll try to do it on the clear possible way.

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:eP**************@TK2MSFTNGP10.phx.gbl... Franco,
Ok, I see, on this case Interface and Implementation are coming on couple
and I have just one implementation for my code.
But still I don't see how ShapeImpl will access to my protected methods and
private variables from Circle because is a object into the Circle object.

Are the protected methods inherited or added to Circle. If you added them

to Circle should they have been added to ShapeImpl instead?

Are they private variables added to Circle itself, should they have been
added to ShapeImpl instead?

For methods you will need to structure the method such that the
Implementation class (ShapeImpl) will be able to see it. Either via an
interface of Friend.

Alternatively ShapeImpl can have call backs (either delegate fields or full events) that it uses to call into Circle when it needs information from
Circle.

For variables I would either make them a member of the Implementation class itself or pass them as parameters when I call into the Implementation class. Normally I would set it up such that each instance of Circle had its own
ShapeImpl, which means that ShapeImpl can hold per instance variables of
Circle, in which case ShapeImpl would not need to access details of Circle.
Hope this helps
Jay
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:e3**************@tk2msftngp13.phx.gbl... As Sherif stated, .NET does not have Multiple Implementation Inheritance, one common method to get around this is to have an Implementation class along with your interface. You would have an IShape interface along with
a
ShapeImpl implementation class. Your Circle class would implement the IShape
interface, then contain a ShapeImpl object as a field, the IShape
method would delegate to the ShapeImple class. NOTE, Circle would NOT inherit

from
ShapeImpl.


Ok, I see, on this case Interface and Implementation are coming on couple and I have just one implementation for my code.
But still I don't see how ShapeImpl will access to my protected methods

and
private variables from Circle because is a object into the Circle object.
Have you considered using creating an Extender Provider class instead?

An Extender Provider is a class (can be either a Component or a Control) that implements the System.ComponentModel.IExtenderProvider interface
allowing you to add new properties to controls. Along with these

properties
you can attach event handlers to the targeted controls enabling you at add functionality.


I didn't know about that and how it works, I'll read that and try a shot.
Thanks very much,
Gustavo.
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in

message
news:u2*************@TK2MSFTNGP10.phx.gbl...
Franco,
As Sherif stated, .NET does not have Multiple Implementation Inheritance, one common method to get around this is to have an Implementation class along with your interface. You would have an IShape interface along with a
ShapeImpl implementation class. Your Circle class would implement the IShape
interface, then contain a ShapeImpl object as a field, the IShape
method would delegate to the ShapeImple class. NOTE, Circle would NOT inherit

from
ShapeImpl.

Have you considered using creating an Extender Provider class instead?

An Extender Provider is a class (can be either a Component or a Control) that implements the System.ComponentModel.IExtenderProvider interface
allowing you to add new properties to controls. Along with these

properties
you can attach event handlers to the targeted controls enabling you at

add functionality.

http://msdn.microsoft.com/library/de...derobjects.asp

http://msdn.microsoft.com/library/de...erprovider.asp

http://msdn.microsoft.com/library/de...idersample.asp

Hope this helps
Jay
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
> But Control doesn't do anything that I want.
>
> Basically, I want derive from Label, Panel, GroupBox, CheckBox,
RadioButton,
> etc. and add my extended funcionalities
>
> The Class control doesn't have any funcionality.
>
> On that case if I derived from Control I have to rewrite each windows > control from scratch wich is "not possible", doesn't make sense.
>
> Thanks,
> Gustavo.
>
> "Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in message > news:%2****************@TK2MSFTNGP11.phx.gbl...
> > Hello
> >
> > Unlike C++, C# doesn't support multiple implementaion inheritance. But > your
> > problem can be solved by deriving the class

ExtendedControlFuncionality
> from
> > Control and deriving your class from ExtendedControlFuncionality.
> >
> > Best regards,
> >
> > Sherif
> >
> >
> > "Franco Gustavo" <gf*****@inuntius.com> wrote in message
> > news:#h**************@tk2msftngp13.phx.gbl...
> > > Hi,
> > >
> > >
> > >
> > > Please help me to understand this, because I don't see what I'm
missing.
> > >
> > >
> > >
> > > I was reading a lot of examples on Internet that explain that C#
doesn't
> > > implement multiple inheritance it implement multiple interfaces.
> > >
> > >
> > >
> > > So, I keep reading and reading and reading to see how can I resolve
my
> > > problem with interfaces.
> > >
> > > The conclusion is I'm writing to all of you because I couldn't

find the
> > way
> > > to resolve my problem.
> > >
> > >
> > >
> > > If I can create multiples interfaces and I have to implement the
methods
> > on
> > > the derived class, then what's the big deal.
> > >
> > >
> > >
> > > I know if I declare a class that inherit from one interface is

useful
> > > because for example
> > >
> > > I can create an Interface called Shape, and 3 Classes called Circle, > > > Rectangle, and Line.
> > >
> > > If on my interface I declare my method Draw(); and I implement on each
> > > derived class then I could do the next.
> > >
> > >
> > >
> > > IShape s = (IShape) AnyShapeObject;
> > >
> > > s.draw();
> > >
> > >
> > >
> > > I think is very useful and I used many times. But now the
question
is
> what
> > > is the similitude between Multiple Inheritance and Multiple
> Interfaces????
> > I
> > > don't see too much
> > >
> > >
> > >
> > > Why on Internet always speak for Multiple Inheritance and
Multiple > > > Interfaces like they have a relation???
> > >
> > >
> > >
> > > My Case:
> > >
> > >
> > >
> > > I have many Windows Control and I'm inherit each one for create my own
> > > Controls.
> > >
> > > For example I want to add method called getVirtualSize();
> > >
> > >
> > >
> > > I create and interface
> > >
> > > IVirtualSize
> > >
> > >
> > >
> > > It contain
> > >
> > > public getVirtualSize();
> > >
> > >
> > >
> > > So, on my derived class I MUST implement my method
getVirtualSize and
> > that's
> > > it.
> > >
> > >
> > >
> > > Very nice!!!
> > >
> > >
> > >
> > > Now the real question is, I create a lot of logic on my paint

method;
> this
> > > logic is exactly the same for all derived classes, why do I have

to > > > implement this entire logic on each Control???
> > >
> > >
> > >
> > > With multiple inheritances you just create a class
> > > ExtendedControlFuncionality and Implement a method OnPaintEx,
and really
> I
> > > have a nice source code, because my class

ExtendedControlFuncionality
> has
> > > all the new extended functionality.
> > >
> > >
> > >
> > > Then how can I do the same with interfaces????
> > >
> > >
> > >
> > > I don't want to put my piece of code on every derived class, it is a > mess
> > > and very difficult to maintain, I want to centralize my source code and
> in
> > > the same time I want to use many methods of the base classes,
that means
> I
> > > want to use all the protected methods that the controls offer to

me > > because
> > > OnPaintEx needs those.
> > >
> > >
> > >
> > > Really, here is only one example, the reality is that is a lot of source
> > > code that I "should" implement on every Control, I don't want to do > that.
> > >
> > >
> > >
> > > Thanks, the answers will be really appreciated.
> > >
> > > Gustavo.
> > >
> > >
> > >
> > >
> >
> >
>
>



Nov 22 '05 #17
Franco,
Anyway all those ways are an alternative, is like there are no a clear way
how to do it without insert a trick o working around. If multiple implementation inheritance is important to you, and you prefer
to target the .NET platform you may want to consider switching to Eiffel
http://www.eiffel.com. It supports multiple implementation inheritance on
the .NET platform. Of course using Eiffel's multiple implementation
inheritance may limit your class libraries to Eiffel. I don't use Eiffel, I
have just read about it on occasion.
So, Then if multiple inheritance and multiples interfaces implementation "I see" are really different, why on 95% on the web site speak like they have a relation? As has been demonstrated Multiple interfaces & delegation is how you
implement multiple inheritance in .NET. So obviously they are related.

If you take implementation out of the picture. In C++ Multiple Class
Inheritance defines a derived type that is composed of multiple base types.
In .NET Multiple Interface Inheritance defines a derived type that is
composed of multiple base types.

In both cases you are defining a derived type that is also "is a" more than
one base type.

In either case you can use the derived type anyplace any of the base types
can be used.

So I'm really not seeing how you consider them not to be related!

Implementation is just one facet of the equation.

Hope this helps
Jay
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Are the protected methods inherited or added to Circle. If you added them to
Circle should they have been added to ShapeImpl instead?

Are they private variables added to Circle itself, should they have been
added to ShapeImpl instead?
No, they belong to the base class.

I see how to do it with callback functions, is not so messy and can work
fine.

Anyway all those ways are an alternative, is like there are no a clear way
how to do it without insert a trick o working around.

So, Then if multiple inheritance and multiples interfaces implementation

"I see" are really different, why on 95% on the web site speak like they have a relation?

Thanks very much, and I'll try to do it on the clear possible way.

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message news:eP**************@TK2MSFTNGP10.phx.gbl...
Franco,
Ok, I see, on this case Interface and Implementation are coming on couple and I have just one implementation for my code.
But still I don't see how ShapeImpl will access to my protected methods and
private variables from Circle because is a object into the Circle object. Are the protected methods inherited or added to Circle. If you added them to
Circle should they have been added to ShapeImpl instead?

Are they private variables added to Circle itself, should they have been
added to ShapeImpl instead?

For methods you will need to structure the method such that the
Implementation class (ShapeImpl) will be able to see it. Either via an
interface of Friend.

Alternatively ShapeImpl can have call backs (either delegate fields or full
events) that it uses to call into Circle when it needs information from
Circle.

For variables I would either make them a member of the Implementation

class
itself or pass them as parameters when I call into the Implementation

class.
Normally I would set it up such that each instance of Circle had its own
ShapeImpl, which means that ShapeImpl can hold per instance variables of
Circle, in which case ShapeImpl would not need to access details of

Circle.

Hope this helps
Jay
"Franco Gustavo" <gf*****@inuntius.com> wrote in message
news:e3**************@tk2msftngp13.phx.gbl...
> As Sherif stated, .NET does not have Multiple Implementation

Inheritance,
> one common method to get around this is to have an Implementation class > along with your interface. You would have an IShape interface along with
a
> ShapeImpl implementation class. Your Circle class would implement

the IShape
> interface, then contain a ShapeImpl object as a field, the IShape

method > would delegate to the ShapeImple class. NOTE, Circle would NOT inherit from
> ShapeImpl.

Ok, I see, on this case Interface and Implementation are coming on couple and I have just one implementation for my code.
But still I don't see how ShapeImpl will access to my protected methods and
private variables from Circle because is a object into the Circle object.
> Have you considered using creating an Extender Provider class
instead? >
> An Extender Provider is a class (can be either a Component or a Control) > that implements the System.ComponentModel.IExtenderProvider interface > allowing you to add new properties to controls. Along with these
properties
> you can attach event handlers to the targeted controls enabling you at add
> functionality.

I didn't know about that and how it works, I'll read that and try a shot.
Thanks very much,
Gustavo.
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in

message
news:u2*************@TK2MSFTNGP10.phx.gbl...
> Franco,
> As Sherif stated, .NET does not have Multiple Implementation

Inheritance,
> one common method to get around this is to have an Implementation class > along with your interface. You would have an IShape interface along with
a
> ShapeImpl implementation class. Your Circle class would implement
the IShape
> interface, then contain a ShapeImpl object as a field, the IShape

method > would delegate to the ShapeImple class. NOTE, Circle would NOT inherit from
> ShapeImpl.
>
> Have you considered using creating an Extender Provider class instead? >
> An Extender Provider is a class (can be either a Component or a Control) > that implements the System.ComponentModel.IExtenderProvider interface > allowing you to add new properties to controls. Along with these
properties
> you can attach event handlers to the targeted controls enabling you at add
> functionality.
>
>

http://msdn.microsoft.com/library/de...derobjects.asp >
>

http://msdn.microsoft.com/library/de...erprovider.asp
>
>

http://msdn.microsoft.com/library/de...idersample.asp
>
> Hope this helps
> Jay
>
>
> "Franco Gustavo" <gf*****@inuntius.com> wrote in message
> news:uS**************@tk2msftngp13.phx.gbl...
> > But Control doesn't do anything that I want.
> >
> > Basically, I want derive from Label, Panel, GroupBox, CheckBox,
> RadioButton,
> > etc. and add my extended funcionalities
> >
> > The Class control doesn't have any funcionality.
> >
> > On that case if I derived from Control I have to rewrite each windows > > control from scratch wich is "not possible", doesn't make sense.
> >
> > Thanks,
> > Gustavo.
> >
> > "Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in

message
> > news:%2****************@TK2MSFTNGP11.phx.gbl...
> > > Hello
> > >
> > > Unlike C++, C# doesn't support multiple implementaion inheritance.
But
> > your
> > > problem can be solved by deriving the class
ExtendedControlFuncionality
> > from
> > > Control and deriving your class from
ExtendedControlFuncionality. > > >
> > > Best regards,
> > >
> > > Sherif
> > >
> > >
> > > "Franco Gustavo" <gf*****@inuntius.com> wrote in message
> > > news:#h**************@tk2msftngp13.phx.gbl...
> > > > Hi,
> > > >
> > > >
> > > >
> > > > Please help me to understand this, because I don't see what I'm > missing.
> > > >
> > > >
> > > >
> > > > I was reading a lot of examples on Internet that explain that C# > doesn't
> > > > implement multiple inheritance it implement multiple interfaces. > > > >
> > > >
> > > >
> > > > So, I keep reading and reading and reading to see how can I

resolve
my
> > > > problem with interfaces.
> > > >
> > > > The conclusion is I'm writing to all of you because I couldn't

find
> the
> > > way
> > > > to resolve my problem.
> > > >
> > > >
> > > >
> > > > If I can create multiples interfaces and I have to implement the > methods
> > > on
> > > > the derived class, then what's the big deal.
> > > >
> > > >
> > > >
> > > > I know if I declare a class that inherit from one interface is
useful
> > > > because for example
> > > >
> > > > I can create an Interface called Shape, and 3 Classes called

Circle,
> > > > Rectangle, and Line.
> > > >
> > > > If on my interface I declare my method Draw(); and I implement on each
> > > > derived class then I could do the next.
> > > >
> > > >
> > > >
> > > > IShape s = (IShape) AnyShapeObject;
> > > >
> > > > s.draw();
> > > >
> > > >
> > > >
> > > > I think is very useful and I used many times. But now the question is
> > what
> > > > is the similitude between Multiple Inheritance and Multiple
> > Interfaces????
> > > I
> > > > don't see too much
> > > >
> > > >
> > > >
> > > > Why on Internet always speak for Multiple Inheritance and Multiple > > > > Interfaces like they have a relation???
> > > >
> > > >
> > > >
> > > > My Case:
> > > >
> > > >
> > > >
> > > > I have many Windows Control and I'm inherit each one for
create my own
> > > > Controls.
> > > >
> > > > For example I want to add method called getVirtualSize();
> > > >
> > > >
> > > >
> > > > I create and interface
> > > >
> > > > IVirtualSize
> > > >
> > > >
> > > >
> > > > It contain
> > > >
> > > > public getVirtualSize();
> > > >
> > > >
> > > >
> > > > So, on my derived class I MUST implement my method getVirtualSize and
> > > that's
> > > > it.
> > > >
> > > >
> > > >
> > > > Very nice!!!
> > > >
> > > >
> > > >
> > > > Now the real question is, I create a lot of logic on my paint
method;
> > this
> > > > logic is exactly the same for all derived classes, why do I
have to
> > > > implement this entire logic on each Control???
> > > >
> > > >
> > > >
> > > > With multiple inheritances you just create a class
> > > > ExtendedControlFuncionality and Implement a method OnPaintEx, and > really
> > I
> > > > have a nice source code, because my class
ExtendedControlFuncionality
> > has
> > > > all the new extended functionality.
> > > >
> > > >
> > > >
> > > > Then how can I do the same with interfaces????
> > > >
> > > >
> > > >
> > > > I don't want to put my piece of code on every derived class,
it
is
a
> > mess
> > > > and very difficult to maintain, I want to centralize my source

code
> and
> > in
> > > > the same time I want to use many methods of the base classes,

that > means
> > I
> > > > want to use all the protected methods that the controls offer
to me
> > > because
> > > > OnPaintEx needs those.
> > > >
> > > >
> > > >
> > > > Really, here is only one example, the reality is that is a lot of > source
> > > > code that I "should" implement on every Control, I don't want

to do
> > that.
> > > >
> > > >
> > > >
> > > > Thanks, the answers will be really appreciated.
> > > >
> > > > Gustavo.
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 22 '05 #18
Hi Jay,

|| As has been demonstrated Multiple interfaces & delegation is
|| how you implement multiple inheritance in .NET. So obviously
|| they are related.

They <are> related in that they use the words multiple and inheritance but
the <quality> of that inheritance is radically different. As you say above
".... is how you implement...". With multiple inheritance of base classes you
<don't> implement - the implementation is carried forward from the base class.

|| If you take implementation out of the picture.

Exactly. But what a big if!!

|| Implementation is just one facet of the equation.

Implementation is the first-order component in the equation!!

To me, the the whole point of multiple class inheritance is bolt-on
implementation. I define my Widget class with three words: Inherits
BaseWidget, CapLinkable. Just that, and I've got a Widget which has
linked-list capabilities and I haven't had to mess around with worker classes,
delegates or anything else.

Using a ShapeImpl, or another worker/helper, with call-backs to get
protected and private members will work, sure, but it's a workaround - around
the gap that multiple class inheritance would have filled.

You have to define the IShape interface. Then you have to implement it,
and, as it's going to be reuseable you implement it in ShapeImpl. But every
class that wants it still has to implement IShape to instantiate and call its
ShapeImpl. Then everything that ShapeImpl needs to do that accesses
private/protected members requires either a Delegate or a part of the IShape
interface - dedicated just to this inter-object communication - while the
target object has to have receiving methods which do their thing and package
up the results and passes them back.

All of the above compared with: Inherits BaseClass, ShapeExtensions,
OtherUsefulStuff.

Hey, I added an extra word and got a whole bunch of other useful stuff.
;-)

Well, that's my moan about it. I'd like the language/framework/compiler
people to put the hard work in so that I can have reusable Capabilities. I'm
not asking for much am I?**

Regards,
Fergus

** Yes, I know - I am! :-D
Nov 22 '05 #19
Fergus,
I am not disagreeing with you or Franco. Multiple Implementation Inheritance
is a very useful tool.

The problem is .NET does not offer it (1.0 or 1.1). Period. Based on the
published roadmap, it will not be offered in .NET 2.0.

Whether it will be offered in .NET 3.0 is anyone's guess.

Franco is trying to understand how in .NET they are related, I am trying to
explain to him how they are related.

So there is no need to get in some academic debate about how great & wonder
Multiple Implementation Inheritance is and how Multiple Interface
Inheritance is not related. I don't buy it.

I'm out of this conversation.

Hope this helps
Jay

"Fergus Cooney" <fi******@tesco.net> wrote in message
news:et**************@TK2MSFTNGP09.phx.gbl...
Hi Jay,

|| As has been demonstrated Multiple interfaces & delegation is
|| how you implement multiple inheritance in .NET. So obviously
|| they are related.

They <are> related in that they use the words multiple and inheritance but the <quality> of that inheritance is radically different. As you say above
".... is how you implement...". With multiple inheritance of base classes you <don't> implement - the implementation is carried forward from the base class.
|| If you take implementation out of the picture.

Exactly. But what a big if!!

|| Implementation is just one facet of the equation.

Implementation is the first-order component in the equation!!

To me, the the whole point of multiple class inheritance is bolt-on
implementation. I define my Widget class with three words: Inherits
BaseWidget, CapLinkable. Just that, and I've got a Widget which has
linked-list capabilities and I haven't had to mess around with worker classes, delegates or anything else.

Using a ShapeImpl, or another worker/helper, with call-backs to get
protected and private members will work, sure, but it's a workaround - around the gap that multiple class inheritance would have filled.

You have to define the IShape interface. Then you have to implement it, and, as it's going to be reuseable you implement it in ShapeImpl. But every class that wants it still has to implement IShape to instantiate and call its ShapeImpl. Then everything that ShapeImpl needs to do that accesses
private/protected members requires either a Delegate or a part of the IShape interface - dedicated just to this inter-object communication - while the
target object has to have receiving methods which do their thing and package up the results and passes them back.

All of the above compared with: Inherits BaseClass, ShapeExtensions,
OtherUsefulStuff.

Hey, I added an extra word and got a whole bunch of other useful stuff. ;-)

Well, that's my moan about it. I'd like the language/framework/compiler people to put the hard work in so that I can have reusable Capabilities. I'm not asking for much am I?**

Regards,
Fergus

** Yes, I know - I am! :-D

Nov 22 '05 #20
Hi Jay,

I'm glad that you see a use for Multiple Implementation Inheritance.
Others argue against it in principle.

|| I'm really not seeing how you consider them not to be related!

You said you had trouble understanding how Franco couldn't see that the
two inheritances were related in as intimate a way as you see it. I was
explaining how I see that connection as being weaker.

|| Multiple Implementation Inheritance is and how Multiple Interface
|| Inheritance is not related. I don't buy it.

I never said that they were unrelated. See above.

|| I don't buy it. ... I'm out of this conversation

I'm sorry if it offended you that I express myself strongly on this issue.
It appears that way.

Regards,
Fergus
Nov 22 '05 #21
In news:uh**************@tk2msftngp13.phx.gbl,
Franco Gustavo <gf*****@inuntius.com> posted:
So, that means if I use VS2003 wich compile with 1.1 can I :
Create a Form, put a Background Image on the Form
Create a Panel and set Color.Transparency like a child of the Form
Create a Radio button like Child of Panel

And the background for the radio button will be the form
Backgorund????????

May you confirm that? if that's true is a excelent news and I'll
switch to VS2003 the soon as possible


Hi Franco,

I'm not that great with VS.NET but (using VS.NET 2003) I created a form and
gave it a Background Image. I added a Panel with BackColor of
Web>Transparent, and added a Button on top of that, again Web>Transparent.
The button's background was the piece of the Form's Background Image that it
was on top of. It looked very nice.

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
ci**************@mvps.org, www.cindywinegarden.com
Nov 22 '05 #22

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Franco Gustavo | last post by:
Hi, Please help me to understand this, because I don't see what I'm missing. I was reading a lot of examples on Internet that explain that C# doesn't implement multiple inheritance it...
7
by: Ant | last post by:
Hi, I’m wondering what practical use is there for creating interfaces. I can fully appreciate creating an abstract class for the purpose of inheriting, but why an interface? Is it just to...
27
by: jm | last post by:
I am having trouble understanding the purposes of an interface, even though the concept of interfaces is around me all the time (user interface, for example). I'm just not understanding software...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.