How to store data from an XML file in a way to reduce coupling

iangel

New Member
So in my C# program, I am reading in a series of commands that a user wants this program to perform from a file. I am currently using XML to store this data.I am having a hard time thinking of a good way to store this data without littering the code with XML data access calls, and thus coupling this to using XML only.Here is an example of the kind of XML I'm using (to give context):\[code\]<cooking> <job> <name>Cook Scrambled Eggs</name> <device>Robo-Chef</device> <action> <name>break eggs into pan</name> </action> <action> <name>scramble the eggs</name> <duration> 00:01:00</duration> </action> </job> <trigger> <name>Breakfast</name> <forJob>Cook Scrambled Eggs</forJob> <start_time> Everyday at 7:00 AM</start_time> </trigger> </cooking>\[/code\]What is a good way to read and store this data in my program from the scheduling XML file, such that the rest of the program is decoupled from the fact it was from an XML file?
 
Back
Top