I think your architect is trying to get your code to have fewer side effects. In your specific example, there is no benefit. In many, many cases, your architect will be right, and you can design large parts of your application without side effects, but one place this cannot happen during database operations.
What you need to do is get acquainted with functional programming and prepare for your conversations about similar cases with your architect. Remember that his intentions are most likely good, but YOUR domain is specific cases. In this case, a side effect is a period, and you most likely want the return type bool to indicate success, but returning a new type does not make sense.
Show your architect that you understand the limited side effects, but certain side effects must be allowed (database, user interface, network access, etc.) and you will most likely find that he or she agrees with you . Find a way to isolate your desired side effects and let them understand him or her, and this will help your cause. Your architect will probably appreciate it if you do it in a collaborative way (without trying to make holes in your plan).
A couple of resources for FP:
Good luck, hope this helps.
Audie
source share