我困住了设计问题。我无法想出任何好的解决方案。这是问题陈述。设计类:每个类封装其他相关类的对象
我有一套设备,每个设备都有一些共同的属性和行为。每个设备可能包含1个或多个其他类型的设备连接到它。例如:如果有4组设备A,B,C,D和A是所有设备的根。
A will have one or many B devices.
B will have one or many C devices.
C will have one or many D devices.
所有这些不同的设备集有一些共同的属性,而有些是自己独有的。
I have to create a report which will read the data from these objects and read it to file. Report is in XML format and will depict hierarchy of whole system.
我怎么能解决这个问题?任何建议评论都会有很大的帮助。
那是什么,我想,当我开始做这个工作的......但我认为可以有更好的方式来解决这个问题 – HadeS