Therefore, I need to create a class that works with a set of paired objects. Between objects there is a one-to-one comparison. I expect the class client to establish this mapping before using my class.
My question is, what is the best way to give a user of my class the opportunity to provide me with this information?
Can I request a collection of such pairs?
MyClass(IEnumerable<KeyValuePair<Object, Object>> objects)
Or separate collections like this?
MyClass(IEnumberable<Object> x, IEnumerable<Object> y)
Or is there another option?
I like the first, because the relationship is obvious, I do not like it because of the extra work that he puts on the client.
I like the second, because types are more primitive and require less work, I don't like this because the mapping is not explicit. I must assume that the order is correct.
Opinions please?
design c # usability
Neil anderson
source share