I have a method in API handler which does API validation, performs business logic and then makes a call to db. Is it a good idea to move the business logic to utility class or service class?
IMO the business logic should be moved to service as utility class are supposed to have methods which can be shared across applications. If I move the business logic to utility class then it will cause a dependency between accessor and utility which will also make it difficult to unit test.
Pls let me know if my reasoning above is correct.