Java 中的架构约束 [英] Architectural Constraints In Java

查看:25
本文介绍了Java 中的架构约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想确保我的项目不包含包之间不必要的依赖项.例如,我想确保项目具有分层结构.IE.模型低于一切,业务逻辑取决于模型,视图取决于业务逻辑和模型.每个层都放在自己的包中.

I want to be sure that my project doesn't contain unnecessary dependencies among packages. For example, I want to be sure that the project has layered structure. I.e. model is below everything, business logic depend on model, view dependes on business logic and model. Each of the layers is place in its own package.

您能否推荐任何允许我指定这些约束并将它们作为持续集成的一部分进行检查的工具,最好是开源工具?

Could you recommend any, preferably open source tools which allow me to specify these constraint and check them as a part of continuous integration?

附言我知道我可以在单独的 maven 模块中分离项目.不幸的是,我的真实案例比三层系统更复杂.如果我使用 maven 模块,我会有几十个非常小的模块.

P.S. I know that I can separate the project in separate maven modules. Unfortunately, my real world case is more complex than 3-layered system. If I used maven modules, I would have several dozens of quite small modules.

推荐答案

Structure101 可让您将图层可视化地定义为单元格架构图,映射到物理代码并检查一致性.这些图表在开发人员的 IDE 中可见,如果违反分层规则,则会生成编辑时间警告.也可以在 CI 期间中断/报告构建.SonarJLattix 是其他视觉依赖控制工具.

Structure101 lets you define your layers visually as cells in Architecture Diagrams which map to the physical code and check conformance. These diagrams are visible in the developers' IDEs and generate edit time warnings if the layering rules are violated. It is also possible to break/report the build during CI. SonarJ and Lattix are other tools for visual dependency control.

这篇关于Java 中的架构约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆