0

I have a very large java application with interdepent classes, it is being decided to convert our big application into modules. To start with this task, I would like to gather ideas.

My questions is almost same as asked here : How to modularize a (large) Java App?

Re-asking this question mainly because it was answered 5 years ago. Any new ideas are welcomed.

4

1 回答 1

1

这不是这个问题的完整答案,我相信问题中的链接仍然有效。这个答案是一些过程建议。

一种开始的方法是创建外观。最初在纸上决定模块的边界在哪里。(哪些类是组成模块的一组类的一部分)然后创建一个外观类(取决于您使用的框架,实现单例或使用spring for ioc)然后每当您从模块外部访问一个类时,都有外部类调用外观,并让外观调用实际类。

如果您有一个外部类对模块类进行多次调用,那么该类属于该模块内部,或者您需要将宏行为(一系列调用和交互)提取到 1 个方法中并将该方法移动到外观中。

于 2014-12-15T12:02:38.330 回答