java 组包_java – 如何组织包(并防止依赖关系周期)?

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类不需要知道神经元子类。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值