It depends what the data represents, but I see no problem with 10
parameters, *as long as* they are clearly named...
However, if the 10 fields represent properties of an entity (as is often the
case with form fields), I would create an object (class) to represent that
entity; the UI would simply read from the form fields, putting the values
into properties on the class; depending on layering (how far my object is
from the DB), I would then either call a Save() method on the object itself,
or call the Save() method on a DAL helper that accepts the (single) object
as a parameter.
Note that this allows the data to be fetched in the same consistent way, and
also allows for the UI to be data-bound directly to the entity class if
appropriate (so no read/write property code).
If I am mistaken, and this /doesn't/ relate to such closely related
properties of an object, then any reasonable approach shold work... again,
/as long as/ the API is clearly named. For example, if it saves a customer
and an order, have SaveCustomerAndOrder() (with the 10 strongly-typed,
clearly-named parameters).
Marc
"MicroMoth" <st***********@forvus.co.uk> wrote in message
news:29**********************************@microsof t.com...
Hi,
I'm trying to write a update method, in which when the user clicks the
update button the update method is passed 10 form fields. Then a update
SQL
is run to update the database.
My question is whats the best way to pass large numbers of parameters into
a
method. Ten seems a large number to be passing into and out of a method.
Stephen