If code the parameter list as seperate arguments then this wouldnt be a problem, but following a taught pattern that i should take collection as parameters in update or create methods.
Assume the there are three members in a class and in the update or create methods that was told code them to take collection, therefore create and update methods of that class take collection but the problme the caller faces that it doesnt know the order and names of each element of the collection.
Assume :
first element should be Number
second element should be Name
third should be Address
Assume the method signature: public void Update(Dictionary
Is this a good practise?
TY in advance
Roei BarPosted Sep 24, 2009, 8:35 AM
multiple arguments are much better
if you want you can build a Typed Parameter and pass it in the UpdateCOmmand
public class ParmamsList
{
public int ParamA;
public int ParamB;
public string ParamC;
}
public void Update(ParmamsList params)
{
}
OK
petre ricardoPosted Sep 24, 2009, 1:07 PM
Joe DickinsonPosted Sep 24, 2009, 11:31 AM
petre ricardoPosted Sep 24, 2009, 7:23 AM
What's the best way to code the method headers to CRUD operation, Collections or seperate Single parameters?
Roei BarPosted Sep 24, 2009, 7:12 AM
if you have a typedList like List
public class UpdateParams
public string ParamA;
public string ParamB;
thats better since you will always get a specific type and still you will have the option to work with multiple params and handle multiple instances