Quote:
Originally Posted by naveenisback
My project is to get the system information like monitor, cpu, os , network..
|
Your other threads don't sound like homework. So I don't know how to react to this one that does.
Quote:
1.take computer as base class , and monitor , cpu, os as derived class.
|
When you try to model physical reality with object oriented inheritance you are looking for "is a kind of" relationships. So "computer" as base class for "monitor" would make sense if "a monitor is a kind of computer". You can't intend that, and I can't think of anything else you might intend with computer as the base class for monitor.
Did you mean computer_part as the base class?
Quote:
2. Take computer as base class and treat Monitor cpu, OS as agregates of Computer..
|
It's even harder to figure out how that is supposed to make sense.
A computer might be an aggregate of computer_parts.
I haven't looked at the source code for the open source project lshw. But it seems to be available easily. A web page on that subject says it is C++ code. It takes a very structured approach to reporting the characteristics of computer components. So it might be a good example to look at. There is a clear advantage to looking at the work of someone who did a good job at a similar task, rather than asking the random opinions of those who might reply to a thread like this.