grails-app / utils目录 [英] grails-app/utils dir
问题描述
我刚刚注意到 grails-app / utils
dir的存在。我从来没有见过它在任何文档中引用过(或在项目中使用过)。它是在你运行 create-app
时默认创建的,任何想法你应该放在那里?
Utility代码是一个明显的猜测,但似乎应该在 src
dir下。
谢谢,
Don
grails-app / utils /
目录是像编解码器这样的项目。
我不确定那里有什么,但是您可以在其中包含其他类,它们将包含在应用程序中
编辑:
grails-app / utils /
目录是为Grails特定实用程序( Artefacts , GrailsClasses 等)
Jeff Brown( Grails开发团队的核心成员)对邮件列表中的问题,以证实这一点。他说:
$ b
您可以在$
utils
目录,但对于Grails特定实用程序而言,它是
。
目前我认为在这个目录下唯一的
是针对
自定义编解码器的。您的应用程序
不是Grails构件
应该放在src / groovy /
$ b下
$ b
您可以在 Constriants插件
中找到新的Grails Artefact示例。一>。该插件的作者建议用户把他们的约束类放在 grails-app / utils /
目录下。I've just noticed the existence of the grails-app/utils
dir. I've never seen it referred to in any documentation (or used in a project). It's created by default when you run create-app
, any idea what you're supposed to put in there?
"Utility" code is an obvious guess, but it seems like that should go under the src
dir.
Thanks, Don
the grails-app/utils/
directory is where items like Codecs go.
I'm not sure what else goes there, but you can include other classes there and they will be included within the Application
EDIT:
The grails-app/utils/
directory is meant for "Grails specific utilities" (Artefacts, GrailsClasses, etc.)
Jeff Brown(Core member of the Grails development team) responded to a question on the mailing list that confirms this. He said:
You can put just about anything you like in the
utils
directory but it is really for Grails specific utilities. At the moment I think the only thing really targeted at this directory are custom codecs. Your application classes that are not Grails artifacts should go undersrc/groovy/
You can find an example of a new Grails Artefact in the Constriants plugin. The Author of this plugin recommends that users put their Constraint classes in the grails-app/utils/
directory.
这篇关于grails-app / utils目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!