zotherstupidguy
zotherstupidguy

Reputation: 3024

Grails Packaging and Naming Conventions

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

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

Another worth mentioning problem I encountered is in naming services Example

SomthingGatewayService.groovy can't be initialized in both these ways - SomthingGatewayService somtinggatewayService
- def somtinggatewayService I understand that the problem is in the 2 Capital Letters 'S'omthing and 'G'ateway before the conventional 'S'ervice, so its probably because of some sort of spring DI issue

So how to resolve this?

Upvotes: 3

Views: 1607

Answers (1)

Siegfried Puchbauer
Siegfried Puchbauer

Reputation: 6539

Yes, putting Domain classes, services, controllers etc. into packages is a good idea IMO. Refactoring it later can be painful. Especially when dealing big applications or applications that grow over time.

Regarding the second problem: If you have a service called SomthingGatewayService then you'll be able to reference it by def somthingGatewayService (just the first letter is lower case).

Upvotes: 3

Related Questions