I am designing a class which produces information like cpu usage,disk usage,Mem usage,...... for 3 systems,lets say data centers which has many workstations and work stations has many PCs.So the CPU usage and the other parameters are required for all the 3 levels(Datacenters, Workstations, Pcs). Please suggest is the below class design correct or how it is to be designed
EDIT
class Datacenters:
def __init__(self,name,location,cpu,mem):
self.name=name
self.location=location
self.cpu=cpu
self.mem=mem
def getparam(self):
return self.name,self.location ,self.cpu,self.mem
def getname(self):
return self.name
class WS(Datacenters):
def __init__(self,name,location,cpu,mem,obj):
#datacentername = Datacenters.__init__(self) #To which data center it is associated
obj.getname() #To which data center it is associated
self.name=name
self.location=location
self.cpu=cpu
self.mem=mem
def getparam(self,obj):
return self.name,self.location ,self.cpu,self.mem,obj.getname()
def getpcname(self):
return self.name
class Pcs(WS):
def __init__(self,name,location,cpu,mem,obj):
obj.getpcname() #To which WS it is associated
self.name=name
self.location=location
self.cpu=cpu
self.mem=mem
def getparam(self,obj):
return self.name,self.location ,self.cpu,self.mem,obj.getpcname()
a = Datacenters("dc1","Bl1",20,30)
print a.getparam()
b = WS("WS1","Bl1",20,30,a)
print b.getparam(a)
c = Pcs("PC1","Bl1",20,30,b)
print c.getparam(b)