Interfaces - OOP theory

  • Thread starter Thread starter Predrag
  • Start date Start date
P

Predrag

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.
 
Thanks Tu-Thach.
That's exactly what I wanted to know.
- Predrag.

Tu-Thach said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top