|
From: | Laurent Julliard |
Subject: | Re: [FR-devel] FileOpenDialog/FileSaveDialog, etc |
Date: | Tue, 01 Oct 2002 09:11:26 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 |
Rich Kilmer wrote:
Question on implementation: Currently, to use these services one does something like: @plugin['/system/ui/services/FileSaveDialog'].call(@@current_dir, "untitled#{$1}.rb") answer = @plugin['/system/ui/services/FileSaveDialog/answer'].data filename = @plugin['/system/ui/services/FileSaveDialog/filename'].data I was wondering about the logic of setting the results to be "global" slot values (/answer and /filename)...why not just do:answer, filename = @plugin['/system/ui/services/FileSaveDialog'].call(@@current_dir,"untitled#{$1}.rb") I don't see the value in the indirection. The point is, for consistency, we either need all proc slots to return values, or set them in slots. I for one would rather have the direct return, unless there is an architecturally useful reason otherwise. Thanks,
I agree with you. In most cases services like these should return the value directly. The only case I can think of where there is an interest to store the return value in slots is for debugging purposes but it could as well be printed in the log file.
Another point in favor of the change is that FR is going to be a thread intensive application as I see it and having sveral threads using the services at the same time and using global data slots to store the results could lead to interesting data overwriting.
So my take a this is go and make the change. Laurent -- Laurent JULLIARD - Xerox R&T/SSTC/XPA - Open Source team >> Host your Xerox Software project on CodeX: http://codex.xerox.com >> address@hidden community: http://xww.linux.world.xerox.com
[Prev in Thread] | Current Thread | [Next in Thread] |