OT: Design questionOld forum URL: forums.lhotka.net/forums/t/6915.aspx
albruan posted on Thursday, May 07, 2009I'm working on a project involving server virtualization. In order to get the information we need, I'm having to execute two separate XML queries against the virtualization software. One query returns such data as number of drives, capacity, free and used space, # of bytes in and # of bytes out, to name but a few. The other query returns such data as CPU idle time, CPU idle states, CPU limit, CPU used, CPU users ... this data is returned from an internal PerfMon. Both of these queries return this data for groups of Containers (the term the software mfgr uses). Since I have two entirely differently formatted XML streams returned from the two queries, I'm having to parse through each one individually using a combination of XPath and the XPathNodeNavigator. My question is how do I then go about combining the data from each of these queries for a particular Container into a single container object?
JonStonecash replied on Thursday, May 07, 2009I would simply retrieve both chucks of data in your get operation and combine them there. The container is a logical set of data and the fact that it is composed of two sets of data should not be exposed to the rest of the application. Think of this as a "join" operation without the support of the database.
I would also strongly suggest that you look at Linq For Xml. It will make your life dealing with XML much easier.
Copyright (c) Marimer LLC