I have a Grails application with a number of services that are starting to get very large.
The flow in the majority of my service methods is
- Database read (Returns DBCursor from MongoDB)
- Iterate through the cursor and perform some operations.
- Return results from operation.
I'm beginning to consider moving the logic in Step 2 out to Groovy classes in order to clean up my code base and allow for unit testing. However reading some guidelines they state that the majority of the logic should go in services.
Is moving this logic out to Groovy classes going aghainst best practices?