'How to pass data with an unknown structure back and forth between plugins

I am creating a plugin architecture that has a common record called IIndividual that the main program recognizes. However, I want to pass an IIndividual record to the plugin, add data to it specific to the plugin, then pass the IIndividual record with the appended data back to the main program and display all the fields.

As the question implies, the appended data in each plugin is different, so there isn't a common interface I can use outside of the CommonKey.

public interface IIndividual
{
    public IIndividual GetRecord(int id);
    
    public IEnumerable<IFunction> PluginOperations();
    
    public ? GetCompleteRecord();
}

My First thought was to use an XML format, the issue with that is that I do get strongly typed variables which might be an issiue if I want to do more than display.

Second thougt was to have a series of sub component interfaces that IIdividual might inherit from. But that will cause the issue of non generic architecture.



Solution 1:[1]

As @Neil said. Having the Plugin Return it's own view to be displayed and work with is the ideal solution.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MrMoonMan