posted 5 years ago
Hi,
This is more of a design question. I have a function which has Object as the return type. Based on the outcome of the function, I will return either my custom object or I will return an exception, so that I will be able to guide to code accordingly. E.G. In the below code, the function foo is calling myCustomFunction which is returning an Object. Now based on the Object's instance I am deciding the subsequent actions. Is the below design a good, bad, or depends on the situation, but try to avoid kind?