开发者

What is the best way to organize directories within a large grails application?

What is the best way to organize directories within a large grails application?

In a typical Spring application, we'd have myproject/domain/ and myproject/web/controllers and myproject/services

Since grails puts these artifacts in their own directories... and then just uses the same base p开发者_C百科roject package for everything, what is the best practice? Use the same sub package name for domain objects, controllers, services too?

Ken


Use packages like any other app. Classes for com.mycompany should go in myproject/grails-app/domain/com/mycompany, myproject/grails-app/services/com/mycompany, myproject/grails-app/controllers/com/mycompany, etc.

Decide on your package structure as makes sense for you. Split on component type or on functionality type (but I recommend functionality type).

I don't see a difference here from the structure you mentioned.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜