HighTechTalks DotNet Forums  

Interface Question

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss Interface Question in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Tao
 
Posts: n/a

Default Interface Question - 09-05-2006 , 01:44 PM






hi, I need help on interface.

I want something like interface, any class implements this interfaces HAS to
do implement method / property declared in this interface.

As there already many functions, I do not want to rewrite all of them. Can I
somehow declare a method which does not care about fucntion parameter list?
Any parameter list is fine for it, it only restrict the return type.

I am not sure if that is possbile.

thanks.

Here is an smaple:

Class A { pubic int F(int a) {... } }
Class B { public int F(string s, a) {.. } }

I want a interface like

interface IA { int F(..); }

so that
Class A : IA
Class B : IB

won't complain.

Thanks again.

Reply With Quote
  #2  
Old   
Alex Turmer
 
Posts: n/a

Default Re: Interface Question - 09-06-2006 , 03:12 PM






Tao wrote:
Quote:
hi, I need help on interface.

I want something like interface, any class implements this interfaces HAS to
do implement method / property declared in this interface.

As there already many functions, I do not want to rewrite all of them. Can I
somehow declare a method which does not care about fucntion parameter list?
Any parameter list is fine for it, it only restrict the return type.

I am not sure if that is possbile.

thanks.

Here is an smaple:

Class A { pubic int F(int a) {... } }
Class B { public int F(string s, a) {.. } }

I want a interface like

interface IA { int F(..); }

so that
Class A : IA
Class B : IB

won't complain.

Thanks again.
I suspect that the solution to your problem lies in finding a different
pattern to the one you are suggesting. It is not clear from you email
what you are trying to achieve over all. However, if one of my team was
to come to me with this question, I would ask why they want to make this
construct and then try and find a more stable way of solving their
overall problem.

AJ

--
www.deployview.com
www.nerds-central.com
www.project-network.com


Reply With Quote
  #3  
Old   
Tao
 
Posts: n/a

Default Re: Interface Question - 09-13-2006 , 11:23 AM



I think you are right and I have changed the structure.

thanks.


"Alex Turmer" wrote:

Quote:
Tao wrote:
hi, I need help on interface.

I want something like interface, any class implements this interfaces HAS to
do implement method / property declared in this interface.

As there already many functions, I do not want to rewrite all of them. Can I
somehow declare a method which does not care about fucntion parameter list?
Any parameter list is fine for it, it only restrict the return type.

I am not sure if that is possbile.

thanks.

Here is an smaple:

Class A { pubic int F(int a) {... } }
Class B { public int F(string s, a) {.. } }

I want a interface like

interface IA { int F(..); }

so that
Class A : IA
Class B : IB

won't complain.

Thanks again.
I suspect that the solution to your problem lies in finding a different
pattern to the one you are suggesting. It is not clear from you email
what you are trying to achieve over all. However, if one of my team was
to come to me with this question, I would ask why they want to make this
construct and then try and find a more stable way of solving their
overall problem.

AJ

--
www.deployview.com
www.nerds-central.com
www.project-network.com


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.