title: Passing data between objects in c#
body: <p>I'm developing a Desktop Applicaiton which is akin to a plugin based system. I have a client module, that will load a DLL containing a 'Machine' object. Thereafter the 'Machine' object is manipulated and used as per well defined interfaces.</p>
  
  <p>The tricky part is that the DLL containing the 'Machine' object is generated on the fly by using another program. At it's core, the DLL generating application accepts user input, generates classes, in c# code files (which contain fields specified by the user, of which I don't have any prior knowledge of) and compiles those classes to a DLL (machine.dll file).</p>
  
  <p>The client program picks up this dll, dynamically loads it and then operates on this machine bject.</p>
  
  <p>I am facing a lot of trouble modeling a solution to address the problem of passing data between the Machine object and the Client program, essentially because I dont know what data is contained in the machine object.</p>
  
  <p>The client program is to do the following things.</p>
  
  <p>-- Load the dll and instantiate the 'machine' object.
  -- Call a series of functions in the 'machine' object, that are known to the client via an interface.
  -- Extract various variables from the 'machine' object and display it to the user.</p>
  
  <p>I am not able to perform the last step.</p>
  
  <p>Note: I have programmed a trivial solution where the meta-data about the fields is generated by the dll generating program and stored in xml files. The client program uses these xml files to get information about the fields stored in the machine object. It then uses reflection on the machine object to access the fields of the object.</p>
  
  <p>I feel this is cumbersome and slow. Are there any patterns or methods to this kind of stuff??</p>