Return a Asset or User entity

0
I have a system that can find an asset OR user object based on a UUID. a MF only allows me to return 1 predefined obj.   what is best practise regarding these kinds of issues?   1. create a NPE and return that, with user or asset associated, then if association != empty, then Asset, else user 2. return a string, something like 'A-$uuid' for asset and 'U-$uuid' for the user, and then have a split that reads the first letter, and then retrieve the correct obj. 3. something else?
asked
1 answers
1

I'd go for the NPE with an association for user and asset and associate the found object and check on the value for the NPE association if either an asset of user was found.

answered