473,396 Members | 1,843 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 - OOP theory

Hello.
Is it a good practice to use classes in interface definition:

Public Interface IMessenger
Sub Send(ByVal msg As CMessage)
....
End Interface

Is this considered to be a better solution:
Sub Send(ByVal msg As IMessage)

Thanks.
- Predrag.

Nov 22 '05 #1
1 1053
Thanks Tu-Thach.
That's exactly what I wanted to know.
- Predrag.

"Tu-Thach" <tu*****@antispam.ongtech.com> wrote in message
news:AE**********************************@microsof t.com...
There is no good or bad practice for using class instead of interface in the definition. If your method only needs the interface, then pass in the
interface. If the interface does not meet your need and the class does,
then pass in the class.
Tu-Thach

----- Predrag wrote: -----

Hello.
Is it a good practice to use classes in interface definition:

Public Interface IMessenger
Sub Send(ByVal msg As CMessage)
....
End Interface

Is this considered to be a better solution:
Sub Send(ByVal msg As IMessage)

Thanks.
- Predrag.

Nov 22 '05 #2

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

Similar topics

1
by: Xah Lee | last post by:
Dear functional programing comrades, Among the community of automatons of the IT industry, there is a popular quote about "theory vs practice" that goes something along the lines of "in theory...
1
by: baylor | last post by:
In C#, an interface cannot mark any method as static. i'm told the ILASM supports it but i've never tested that Two questions. First, why? OK, i've heard the reason about interfaces being...
19
by: Duncan McNutt .[FTSE] | last post by:
Why does code derive from for example, IComparer ie, class SomeClass : IComparer { public SomeClass() { }
6
by: Tony Nassar | last post by:
Could someone clarify why this doesn't work? Is there a persuasive reason why it shouldn't? interface IGetOnly { string Name { get; } } interface IGetAndSet : IGetOnly { string Name { set;...
30
by: Frank Rizzo | last post by:
We are having one of those religious debates at work: Interfaces vs Classes. My take is that Classes give you more flexibility. You can enforce a contract on the descendant classes by marking...
8
by: John | last post by:
What is the purpose / benefit of using an interface statement? It doesn't seem like anything more than a different way to make a class... (except you can't define any procedures in an interface...
24
by: Rob R. Ainscough | last post by:
VS 2005 I have: ClickOnce deployment User's that hate and or don't want to use an IE Client (don't blame them) I don't see how ASPX web pages are going to survive? With .NET 2.0 and clickonce...
7
by: Dave Benjamin | last post by:
There's been a lot of discussion lately regarding Ruby and the notion of a "humane" interface to objects like arrays and maps, as opposed to "minimalist" ones. I believe the article that started...
4
by: seets375 | last post by:
Hi, I have two ethernet interfaces on my system, with IPs assigned to the interfaces from different subnets (e.g. eth1 - 10.10.10.10 and eth2 - 20.20.20.20 ). I'm connecting these interfaces to...
22
by: RSH | last post by:
Hi, I have been reading on interfaces working on samples I've run across on the web. For the life of me I cannot seem to grasp them. It appears to me that interfaces are simply blueprints to...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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:
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.