Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameters and arrays
Message
From
06/08/2010 10:29:09
 
 
To
06/08/2010 09:41:27
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01475479
Message ID:
01475530
Views:
32
>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.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform