Java calling methods from restricted layer

后端 未结 2 1905
半阙折子戏
半阙折子戏 2021-01-16 21:15

I\'m not even sure if this is doable but I want to ask the community for their general opinion.

I have to solve a following problem:

My Project has 2 Layers,

相关标签:
2条回答
  • 2021-01-16 21:19

    What you are probably facing is the design of module dependency and circular dependency. In short, the Business methods that Core needs may have to be re-factored into a 'utils' module or a 'Business-Core' module that is then accessible by both. I am only guessing here.

    In addition to automating builds, a build tool like Maven also encourages such modularization and dependency. It is not unusual for a project that started off as one module to be split into 3-4 modules by the time it is done.

    0 讨论(0)
  • 2021-01-16 21:39

    This can be achieved by using AspectJ. You can write rules in AspectJ-syntax which will give build-time-errors if not enforced. See the article Archtectual Enforcement with Aid of AspectJ for an example.

    0 讨论(0)
提交回复
热议问题