如何简化应用结构?
简化项目关系并在项目中编写代码始终是一个好主意。
但由于我不是软件分析员并试图开始分析我的个人项目。我想知道如何简化项目结构?
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在不了解有关项目的任何细节的情况下,很难提供比一般建议更多的建议,例如
耦合是对其他外部组件的依赖(即,您的类的其他类,包的其他包,项目的其他项目)。低耦合意味着此类依赖性保持在必要的最低限度。
内聚是类/包/项目内部之间的依赖关系。高内聚意味着类/包/项目的内容在逻辑上属于在一起。
低耦合和高内聚意味着逻辑上属于在一起的东西在物理上也在一起,逻辑上不相关的东西不会不必要地捆绑在一起。这使得理解、维护和扩展你的程序变得更加容易。
如果您的程序很大,自动化静态代码分析工具可以帮助测量这些(和类似的)事情。由于我不熟悉 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.