How To Simplified Application Structure?
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 ?
Without knowing any details about your project, it is hard to offer more than general advice like
- strive to achieve low coupling and high cohesion within your classes, packages and projects
- strive to write your classes such that they depend on interfaces, rather than concrete classes
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.
精彩评论