>VisualFoxPro does not support parameter overloads for the same procedure/function. This might be a reason to use parameter as array or set of parameters as object properties. VS free in this, and support overloading.
Even in .NET, if this is supported, I only use it at one location as I try to avoid that. I understand that sometimes it would be overkill to class everything so a method call with parameters would be required. But, in general, most of the important things are in classes and the rest, methods, are for small purposes only.
>Second, I am not sure you way with set properties of object before call the method is a good way. I explain why.
>Because in this case you don't know exact order of set value to the properties, and its increase overhead in programming.
I never had any problem with that. To me, at least, it has proven to be ok so far.
>First reason - external developer can forgot to set the property value, then method will FAIL in RUNTIME.. but in case with parameters - all problem fixed on DESIGN TIME. This is important!
It is a good point.
>Second reason - When programmer writing the code - he can see method overloads, types, and OPTIONAL parameters. Of course you can initialize your control with default property values, but on my private look, when I am programming, I'd like to see what I send to the method..
When I add an item in a collection, I would use that approach as, as you said, we know what we have to pass. But, this method is part of a class and the most important properties are already set.