Does This Belong In a Dictionary?

Paul Rudin Paul_Rudin at scientia.com
Mon Dec 9 09:10:43 EST 2002


>>>>> "beno" == beno  <zope at thewebsons.com> writes:

 beno> Hi; I'm writing UML for a shopping cart. Some of the methods
 beno> have huge amounts of variables passed back and forth.

 beno> example, the following:

 beno> cueForShipment(customerID:int;basketID:int,firstName:string,middleInitial:string,lastName:string,address1:string,address2:string,city:string,state:string,zip:string,shipFirstName='':string,shipLastName='':string,shipaddress1='':string,shipAddress2='':string,shipCity='':string,shipState='':string,shipZip='':string,country:string;shipCountry='':string,wrapGift:bool)

 beno> Should I simply pack everything but the IDs into a dictionary?
 beno> TIA, beno

I'm not sure exactly what the correct solution is, but methods with
signatures like that suggest to me at least that things need be
redesigned one way or another. In the example above it looks a lot
like you should be doing something like passing in a "customer"
object, an "address" object and a flag for the gift wrap thing.


-- 
I think I'll do BOTH if I can get RESIDUALS!!



More information about the Python-list mailing list