Why is the Process class in the Diagnostics namespace?

妖精的绣舞 提交于 2019-12-03 22:03:24

The process class doesn't just represent a single process. It has a ton of information about the running processes on the computer. This info can be used to find problems or just get general information about your system state.

you can see the diagnostics namespace description here: http://msdn.microsoft.com/en-us/library/system.diagnostics.aspx

and the process class description here: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx

Well, according to the documentation, "The System.Diagnostics namespace provides classes that allow you to interact with system processes, event logs, and performance counters." So I guess by definition it fits. :-)

But yes, it does seem a bit like an overloading of terms by putting it next to things a bit more obviously diagnostics-related (tracing, performance counters).

Still, I would say that the Process class is as much about monitoring running processes as it is about starting new ones. Monitoring is generally accepted as a diagnostic activity. Furthermore, it might be less intuitive to most programmers if the framework had split up functionality pertaining to the same item in separate namespaces. So I can see the logic of including it here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!