Service method or domain static method in Grails?
This is a design question:
- when do I need to create/use a static method (in a domain class for instance)
- when do I need to create/use a service instead?
What is the difference开发者_JAVA百科 between them?
If the method is to do only with the behaviour/details of the domain class then I'd make it a method on the domain (not necessarlily a static one). If it is more related to business logic then I'd put it in a service.
cheers
Lee
精彩评论