Does This Belong In a Dictionary?

beno zope at thewebsons.com
Mon Dec 9 09:46:17 EST 2002


At 02:10 PM 12/9/2002 +0000, you wrote:
> >>>>> "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.

Yep: that's the consensus and what I've been doing. But as I mentioned in a 
subsequent post you may have missed, since I'm separating the UI and PD, 
the UI is of necessity passing some lengthly arguments to the PD and 
conversely the PD back to the UI. I've decided to put everything in various 
dictionaries. Good idea?

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

LOL! It's open source...good luck getting anything :/
beno






More information about the Python-list mailing list