Overloaded Properties in VB.NET?
I'm getting ready to finish up the marketing on a product I've recently acquired and am ready to release, but before I can, I need to ask a question. Hopefully all you intelligent developers out there can give me an answer. This question applies to VB.NET developers only. (Yes I realize the looping syntax below is in C#, the product is written in C#, the code is targeted at VBers.)
Are there any legitimate reasons to overload a property definition?
The reason for this question is that there are several bugs in the VS.NET CodeDom that create a problem for this situation, and I will try to outline them as I understand them here. Basically, if you try to loop forwards or backwards through all the members of the CodeType object, you will always get back the first position in the collection. It happens if you use either looping syntax:
- foreach (CodeElement mem in ct.Members)
- for (int i = 1; i <= ct.Members.Count; i++)
...Same response every time. Now, I'm not a terribly advanced coder. So, without going into details about this product (because most of the details are not final yet), I feel that we can leave it as a known issue in the current version, make it clear that we don't support this particular situation, and work with Microsoft to get it repaired in Whidbey. Personally, I don't see it as an issue, because I never overload properties. But I want to understand what others deal with, and the kinds of situations (hopefully with real-world code, not a contrived example) where this methodology would be effective. Then I can understand the needs of those that might be using the product, and decide what to do from there.
Thanks in advance.