What's the difference between these 2 methods? is one of them is more better then the other?1. MyObject DoSomething(string someInput)2. IMyObject DoSomething(string someInput)
In term of using the methods , the usage is the same.although the second approach is more flexable, enables the method's ownerto change the return value without changing the method signature and thereforethere's no need to comiple the code again.returning an interface enables the method owner to change the return value from an object to a list of object or even a primitive type without breaking the code.