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.
 
Back
Top