0

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, a Core layer and a Business layer. This Core layer is providing the Business layer. At this moment Business classes can import Core classes and do whatever they want. Core classes can only import core classes and use their methods, the access to Business classes and their respective methods is forbidden.

I want to add a specific feature: I don't want to give Core any normal access to the Business layer, but I want to create something like an interface or anything similar (I don't know how to express myself here cause I have no idea if its possible), that provides the Core classes some specific methods from Business classes to use.

Can anyone help me out, or at least give me some guidelines what to read, or where to search.

Thanks in advance for any support.

Edit: I use Spring Framework with Seam and JBoss

4

2 に答える 2

1

おそらく直面しているのは、モジュール依存関係と循環依存関係の設計です。つまり、Core が必要とするビジネス メソッドは、'utils' モジュールまたは 'Business-Core' モジュールにリファクタリングして、両方からアクセスできるようにする必要がある場合があります。私はここで推測しているだけです。

ビルドの自動化に加えて、Maven のようなビルド ツールは、そのようなモジュール化と依存関係も促進します。1 つのモジュールとして開始したプロジェクトが、完了するまでに 3 ~ 4 つのモジュールに分割されることは珍しくありません。

于 2012-11-22T08:46:52.490 に答える
0

これは、AspectJ を使用して実現できます。強制されない場合、ビルド時にエラーが発生するルールを AspectJ 構文で記述できます。例については、AspectJを使用したアーキテクチャの適用に関する記事を参照してください。

于 2012-11-22T08:42:46.443 に答える