模块化大型Grails应用程序的最佳做法? [英] Best practice to modularise a large Grails app?

查看:124
本文介绍了模块化大型Grails应用程序的最佳做法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发的Grails应用程序变得越来越大,将其重新导入到几个模块将是很好的,所以我们不必每次重新部署整个操作。

A Grails app I'm working on is becoming pretty big, and it would be good to refactor it into several modules, so that we don't have to redeploy the whole thing every time.

在几个模块中分割Grails应用程序的最佳做法是什么?
特别是我想创建一个域类+相关服务的包,并将其作为一个模块在应用程序中使用。这可能吗?是否可以使用插件来实现?

What is the best practice to split a Grails app in several modules? In particular I'd like to create a package of domain classes + relevant services and use it in the app as a module. Is this possible? Is it possible to do it with plugins?

推荐答案

这是什么插件。在将大型应用程序拆分成多个模块的情况下,使用inline plugin功能极其有用。只需添加

that's what plugins are for. In case of splitting up a large app into several modules, using the "inline plugin" feature is extremly useful. Just add

 grails.plugin.location."<plugin-name>" = "<path to plugin dir>" 

到您的应用程序的 grails-app / conf / BuildConfig.groovy 。通过这样做,您不必在插件中进行每次修改后再运行 package-plugin install-plugin

to your app's grails-app/conf/BuildConfig.groovy. By doing so, you no longer have to run package-plugin and install-plugin after every modification inside a plugin.

有关使用插件的详细信息,请参阅Grails参考文档或可用的书籍之一:Grails的最终指南或Grails in Action。两者都是绝对值得的。

For details on using plugins, see Grails reference docs, or one of the available books: "Definitive Guide to Grails" or "Grails in Action". Both are absolutely worth their costs.

这篇关于模块化大型Grails应用程序的最佳做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆