如何简化应用结构?

发布于 2024-08-23 11:30:12 字数 80 浏览 4 评论 0原文

简化项目关系并在项目​​中编写代码始终是一个好主意。

但由于我不是软件分析员并试图开始分析我的个人项目。我想知道如何简化项目结构?

It is always a good idea to simlified the project relations and also writing code in projects.

But as I am not a software analyzer and trying to start analyzing my personal project. I want to know that How To Simplified Project Structure ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长伴 2024-08-30 11:30:12

在不了解有关项目的任何细节的情况下,很难提供比一般建议更多的建议,例如

耦合是对其他外部组件的依赖(即,您的类的其他类,包的其他包,项目的其他项目)。低耦合意味着此类依赖性保持在必要的最低限度。

内聚是类/包/项目内部之间的依赖关系。高内聚意味着类/包/项目的内容在逻辑上属于在一起。

低耦合和高内聚意味着逻辑上属于在一起的东西在物理上也在一起,逻辑上不相关的东西不会不必要地捆绑在一起。这使得理解、维护和扩展你的程序变得更加容易。

如果您的程序很大,自动化静态代码分析工具可以帮助测量这些(和类似的)事情。由于我不熟悉 C#,我无法给出任何有关 C# 工具的提示,但我确信您通过谷歌搜索会找到一些。

Without knowing any details about your project, it is hard to offer more than general advice like

Coupling is the dependencies to other, external components (i.e. other classes for your class, other packages for a package, other projects for a project). Low coupling means that such dependencies are kept on the necessary minimum.

Cohesion is the dependencies between the internals of a class / package / project. High cohesion means that the contents of your class / package / project logically belong together.

Low coupling and high cohesion means that the stuff which logically belongs together is physically together as well, and logically unrelated things are not tied together unnecessarily. This makes it much easier to understand, maintain and extend your program.

If your program is big, automated static code analysis tools can help measure these (and similar) things. As I am not familiar with C# I can't give any hints on C# tools, but I am sure you find several by googling around a bit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文