简体   繁体   English

播放2.2.1子项目与子包?

[英]Play 2.2.1 sub-projects vs sub-packages?

I know my question is a little weird ,but i will try to explain. 我知道我的问题有点怪异,但我会尽力解释。

Me and other 8 programmers are working on the same project ( 2 teams ) , and each team has its own responsibilities , so we thought why not to split our play project to modules so each team can work on their module? 我和其他8位程序员在同一个项目(2个团队)中工作,每个团队都有自己的职责,所以我们想为什么不将我们的游戏项目划分为模块,以便每个团队都可以在各自的模块上工作?

After search about play sub-project and sbt multi projects , we are afraid the benefit from this move is lower than the cost of setting every thing up (we already have a play project built on top of our infrastructure ). 在搜索了play子项目和sbt multi项目之后,我们担心此举带来的好处会比设置一切所需的成本低(我们已经在基础架构之上构建了一个play项目)。

So I have been thinking why not to just split our route file to multiple routes files with some how corresponding packages ? 所以我一直在想为什么不将我们的路由文件拆分为多个具有相应包的路由文件?

In short , i would really appreciate a little review on the benefits of sub-projects and in which use case i should use them , because i found almost nothing on this on the web . 简而言之,我真的很希望对子项目的好处以及在哪种用例中应该使用它们进行一些回顾,因为我在网上几乎找不到任何东西。

BTW , it's play java , although it does not matter that much in this case.. 顺便说一句,它扮演的是Java,尽管在这种情况下没关系。

Thanks in advance! 提前致谢!

Some benefits from the top of my head: 从我的头上得到一些好处:

  • Faster compilation, sbt can compile just those modules that changed and can compile modules in parallel if the dependency tree allows for it 编译速度更快,如果依赖项树允许,sbt可以只编译那些已更改的模块,并且可以并行编译模块
  • Faster testing, same as with compilation 测试更快,与编译相同
  • Protection against accidental coupling between separate parts, if there is no dependencies between two submodules A and B there can be no accidental usage of classes from A in B 防止不同部分之间的意外耦合,如果两个子模块A和B之间没有依赖关系,则不会意外使用B中A的类
  • When separating things into suprojects: Makes accidental tight coupling painfully visible (why on earth does User depend on Play cache???) 将事物分成suproject时:使意外的紧密耦合痛苦地可见(用户到底为什么依赖Play缓存???)
  • Makes it possible to make parts of the code base totally decoupled from play, so that they can be used in any Scala project 使部分代码库与游戏完全脱钩成为可能,以便它们可以在任何Scala项目中使用
  • Future option of making any subproject a project/library with it's own lifecycle, for example integration projects that is written once and then almost never changes can be "released" to a corporate repository 使子项目成为具有自己生命周期的子项目/库的未来选择,例如,可以编写一次然后几乎绝不更改的集成项目,可以“发布”到公司存储库中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM