|
RE: A Question of Style: msg#00163lang.smalltalk.squeak.beginners
I like the second one; it explains your intention much better. Ron > From: Tim Johnson > > Hi, > > I know the rules for naming accessor and setter methods. But what do I do > when the accessor method needs a parameter? I'll try to provide an > example. > > A vendor sells an item called #apple. If I want to get the vendor's price > for that #apple, I use a method such as the following: > > Vendor>>priceOf: aSymbol > > Now, to make the setter method, I have followed this pattern: > > Vendor>>priceOf: aSymbol is: newPrice > > Does this follow traditional patterns? I'll admit I have read the first > half of "Smalltalk with Style" but not the second. Should I instead make > the setter method look like this: > > Vendor>>setPriceOf: aSymbol to: newPrice > > ? > > Thanks, > Tim > > [PS - Thanks to everyone who has been helping me on here lately, I have > been lax in responding. You all bring up some good ideas and tips.] > > _______________________________________________ > Beginners mailing list > Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx > http://lists.squeakfoundation.org/mailman/listinfo/beginners
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | A Question of Style, Tim Johnson |
|---|---|
| Next by Date: | Re: A Question of Style, Ralph Johnson |
| Previous by Thread: | A Question of Style, Tim Johnson |
| Next by Thread: | Re: A Question of Style, Ralph Johnson |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |