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.
 

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