antcontrib VerifyDesign task将帮助您做所需:
For example, if there are three
packages in one source tree
06000
and naturally presentation should only
depend on business package, and
business should depend on dataaccess.
If you define your design this way and
it is violated the build will fail
when the verifydesign ant task is
called. For example, if I created a
class in biz.xsoftware.presentation
and that class depended on a class in
biz.xsoftware.dataaccess, the build
would fail. This ensures the design
actually follows what is documented(to
some degree at least). This is
especially nice with automated builds
所以一旦你决定如何组织事情,你可以在编译时强制执行这些要求。您也可以获得罚款控制权,因此您可以允许某些案例打破这些“规则”。所以你可以允许一些周期。
根据你想做什么,你可能会发现“utils”包是有意义的。
对于你引用的特定情况,我可能会这样做:
>包nn包含Nueron和Connection
> package nn.neurons包含Nueron的子类
神经元和连接都是NeuralNetowrk中使用的高级概念,所以把它们放在一起是有道理的。 Neuron和Connection类可以互相引用,而Connection类不需要知道神经元子类。