I am currently going through the process of designing a pretty complex object hierarchy for a project, something that I haven’t done for a while. The big difference this time around is that I am doing the design to be put into C#, the new language that Microsoft introduced as part of .Net. The last time I’d done a hierarchy this complex, we’d been working in Java.
Anyway, I’ve just had a fairly frustrating time trying to create a hierarchy to meet my requirements in C#, made all the more annoying because I know I can do it in Java, and more than that, J#, the Microsoft version of Java can do it too. The problem is that I want to use overloaded and polymorphic properties, and C# just won’t have it. What I want to do is supported by the CLR, and by other .Net languages, just not C# or VB.Net.
This now leaves me with an interesting quandary. I can probably shoehorn a way around the limitations of the language – but it won’t be nice. Or I can write my object hierarchy in J#, and use it from C# without a problem. Decisions decisions…
Also published on Medium.