New answers tagged

0 votes

What are the tradeoffs between a Union type or a wrapper Class to represent a formatted string argument representing multiple types

If you want separate Types for Foo and Bar the union approach is flawed. After you parse the string you need to check for null to see what if any Type was parsed. As you add more types you will have ...
user avatar
  • 64.5k
1 vote

What are the tradeoffs between a Union type or a wrapper Class to represent a formatted string argument representing multiple types

Ignoring some of these implementation details, the advantage of the second approach is the ease with which a BazId can be added. Of course none of that matters unless Id's being different types ...
user avatar
0 votes

Should i implement same interface in derived class?

If the parent class and the derived class implement the same interface then maybe there is a situation where the derived class might want to code an interface method differently to how it is coded in ...
user avatar

Top 50 recent answers are included