Relative Content

Tag Archive for c#.netparsing

How to avoid using a method with a parameter of type object when using an interface which will be used in a collection

So I want to try to avoid using object in my methods to make things more type safe and avoid boxing/unboxing but I’m not sure what the best way to solve this is. Using generics is not ideal for this situation here since there will be a collection of the type (so it cannot have generic params). I’m thinking a solution that uses double dispatch might work here (i.e. visitor pattern).