English 中文(简体)
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?

问题回答

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).





相关问题
IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

ASP.net web services

I am using a web service which sets the Thread.CurrentPrincipal object while logging in and soon later when another webmethod of the same web service accesses Thread.CurrentPrincipal, its different/...

Unity Container Disposing and XML Web Service

I am registering some wrapers over un-managed objects in container. How can I dispose of them at the end of the container s lifetime? Please bear in mind I have an XML Web service.

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

热门标签