*sorry for the first offlist reply :) * You'r right and this reminds me the following good practices, also known as the zen of python (but applies to all languages):
Source : http://www.python.org/dev/peps/pep-0020/ Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! Le 17 févr. 2010 à 13:26, Mike Schrag a écrit : > My official policy is that toString() should never be used for real code > dependencies -- it should only be for debugging. It's much better to be > explicit, IMO. > > ms > > On Feb 17, 2010, at 5:28 AM, Frédéric JECKER wrote: > >> ... or add a toString() method to your object :) >> >> Le 16 févr. 2010 à 17:53, James Cicenia a écrit : >> >>> I swear.. I mean it, really, I do, I had .name tagged on that. >>> >>> Too much D2W can totally mess with one's mind. >>> >>> I will slay this beast! I swear. >>> >>> >>> >>> On Feb 16, 2010, at 10:35 AM, Ramsey Gurley wrote: >>> >>>> Because you're binding to the object, not a string. Use something like >>>> >>>> displayString = aFestivalArtist.userPresentableDescription >>>> >>>> instead. >>>> >>>> Ramsey >>>> >>>> On Feb 16, 2010, at 11:28 AM, James Cicenia wrote: >>>> >>>>> Why won't displayString not display the string but the ugly object info? >>>>> >>>>> Here is the scenario. >>>>> >>>>> My own D2W custom popup component to set a relationship. Seemingly >>>>> trivial. >>>>> >>>>> wod: >>>>> >>>>> PopUpButton1: WOPopUpButton { >>>>> list = thePerformance.festival.festivalArtists; >>>>> selection = theFestivalArtist; >>>>> noSelectionString = "-- Select Artist --"; >>>>> item = aFestivalArtist; >>>>> displayString = aFestivalArtist; >>>>> } >>>>> >>>>> java: >>>>> >>>>> public class PickFestivalArtist extends ERDCustomComponent { >>>>> public FestivalArtist theFestivalArtist; >>>>> public FestivalArtist aFestivalArtist; >>>>> >>>>> public PickFestivalArtist(WOContext context) { >>>>> super(context); >>>>> } >>>>> >>>>> public boolean isStateless() { return false; } >>>>> >>>>> public Performance thePerformance() { return >>>>> (Performance)valueForBinding("object"); } >>>>> >>>>> >>>>> public void setTheFestivalArtist(FestivalArtist newValue) throws >>>>> Exception { >>>>> thePerformance().takeStoredValueForKey(newValue, >>>>> "festivalArtist"); >>>>> } >>>>> >>>>> public FestivalArtist theFestivalArtist(){ >>>>> return (FestivalArtist)thePerformance().festivalArtist(); >>>>> } >>>>> } >>>>> _______________________________________________ >>>>> Do not post admin requests to the list. They will be ignored. >>>>> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >>>>> Help/Unsubscribe/Update your Subscription: >>>>> http://lists.apple.com/mailman/options/webobjects-dev/ramsey%40xeotech.com >>>>> >>>>> This email sent to ram...@xeotech.com >>>> >>> >>> _______________________________________________ >>> Do not post admin requests to the list. They will be ignored. >>> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >>> Help/Unsubscribe/Update your Subscription: >>> http://lists.apple.com/mailman/options/webobjects-dev/f.jecker%40symaris.com >>> >>> This email sent to f.jec...@symaris.com >> >> _______________________________________________ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40mdimension.com >> >> This email sent to msch...@mdimension.com >> >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com