Grails Packaging and Naming Conventions

Packaging controllers, services, etc. i.e. com.company.controllers - com.company.services

Is this a good practice or should it be avoided by any means?

Another Noteworthy Problem I Encountered In Naming Services Example

SomthingGatewayService.groovy cannot be initialized in both ways - SomthingGatewayService somtinggatewayService
- def somtinggatewayService I understand that the problem is "S'omthing" 2 "Capital Letters" and "G'ateway to normal" S'ervice, so probably from for some kind of spring DI problem

So how to solve this?

+3
source share
1 answer

Yes, placement of classes, services, controllers, etc. in packages is a good IMO idea. Refactoring can later be painful. Especially when working with large applications or applications that grow over time.

Regarding the second problem: if you have a service called SomthingGatewayService, you can refer to it def somthingGatewayService(only the first letter is a lowercase letter).

+3
source

Source: https://habr.com/ru/post/1722679/


All Articles