interfaces and overloaded functions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was wondering if the following interface example is good programming
practice:

Public Interface IExample
Function GetInfo(byval index as Integer) as SomeObject
Function GetInfo() as SomeObject()
End Interface

Is it a problem for one function to return different types or it it better
to have two separate functions like:

Public Interface IExample
Function GetInfo(byval index as Integer) as SomeObject
Function GetEverything() as SomeObject()
End Interface

Any suggestions as to pros and cons is appreciated.
 
I think this is strictly a matter of design preference. I see no pros or
cons to either approach.
 
Back
Top