Hey.
There are a number of objects with different implementations, but a single interface:
public interface IComponent<Tin, Tout> where Tin : struct where Tout : struct { IParameters<Tin, Tout> ComponentParameters { get; } ... }
Tin, Tout - enum'y, separate for each type of object. They contain a list of parameters required for the organization of dictionaries:
public interface IParameters<Tin, Tout> where Tin : struct where Tout : struct { Dictionary<Tin, string> InputStruct { get; } Dictionary<Tout, string> OutputStruct { get; } }
Objects are the constituent elements of a compound object. At the moment, this is partially implemented as a set of fields and properties:
private List<Component1> _cmp1; // Component1 : IParameters<Tin1, Tout1> private List<Component2> _cmp2; // Component2 : IParameters<Tin2, Tout2> ... public List<Component1> Comp1 { get { return _cmp1; } set { _cmp1 = value; } } public List<Component2> Comp2 { get { return _cmp2; } set { _cmp2 = value; } } ...
, and a set of fields and methods of access to them:
private List<Component3> _cmp3; private List<Component4> _cmp4; ... public List<T> GetComponent34<T>() { ... } public int SetComponent34<T>(List<T> value) { ... }
Each type of object is based in a separate assembly. I want to separate the implementation of the compound object from the features of the components that do not allow to push them all, for example, in one list. The main ones are naturally enums. However, how to do this, something does not come to my head.
PS It is also quite possible that the lists of parameters will not be loaded from enums, but from an external source, but for now I would like to resolve the issue with enums.
List<IComponent<???, ???>>
- what do you want to specify as parameter types? - andreycha