Circular dependencies or the right way to create a project

I have a project for a web application.

  • Most of the classes in this project should be compiled into a .jar file and placed on the server in a directory codebase/WEB-INF/lib. These classes are used only by the server.

  • But I have several classes that need to be used on the server and client. These classes should be placed directly in codebase / [package.class].

  • All these classes depend on each other and vice versa.

The end of the story. Now I am trying to move my project from the IDE assembly to Gradle . My project contains two modules that depend on each other. InteljID warns me and compiles this fine. But with Gradle he is stuck. So, can I somehow break these classes into two logical groups and have an easy way to build the structure described above?

I tried to create a multi-project assembly, several source kits, but everywhere I got the same circular dependency errors.

+4
source share
2 answers

. - , , . . .

, , . , ? , . , , . , .

:

  • " "
  • Michael Feathers
+5

, , Java : http://sourceforge.net/projects/jcycles/

, , ( ) ( , , , , ( ..)).

( ) , .

, , , , , ( ).

-

+1

Source: https://habr.com/ru/post/1545637/


All Articles