Ceratainly possible. You'd want a discovery mechanism for a new Preference Browser also, otherwise who would know what the preferences are. The method flow would still be similar, unless you had some redirection to alternate classes or methods or blocks... So, in new scheme (no dependency on Preferences) the doSomething might be: self class shouldUseNewDiffTool ifTrue: [kjlhkjhjkh ] ifFalse: [nkjhkjkjhkj] and MyTool class>>preferences would answer something suitable for a preference browser. Regards, Gary. ----- Original Message ----- From: "Stéphane Ducasse" <stephane.ducasse@inria.fr> To: <Pharo-project@lists.gforge.inria.fr> Sent: Wednesday, February 04, 2009 7:58 AM Subject: [Pharo-project] About Preference Flow: was Re: Monticello ChangesDialog
Gary
I have a request about the way we use preference. And this is kind of really really important if we want to stop having spaghetti code.
Instead of having the current situation ie
MyTool>>doSomething
.... Preferences useNewDiffTool ifTrue: [kjlhkjhjkh ] ifFalse: [nkjhkjkjhkj]
and not been able to remove the preferences (or that the preference is just a configuration layer).
I would like to have the preference made that way
MyTool class>>useNewDiff
MyTool class>> useOldDiff
**NO REFERENCE TO PREFERENCE IN THE METHOD FLOW!!!!
Preferences useNewDiffTool MyTool useNewDiff
I really think that we can do it that way and this way we would have a much more object-oriented system Do you think that this is possible with polymorph? I think so.
Stef
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project