On Mon, 17 Apr 2006 13:40:48 -0300, "bulia byak" <buliabyak@...400...> wrote:
I know you like the "context" idea. But please compare your description above with the current situatuion: we have a global Application object which follows the current desktop and passes it along whenever you call SP_ACTIVE_DESKTOP. So what's the difference?
Mainly that the fact is currently buried behind the implementation of inkscape_active_desktop(). But I also hope that there would no longer even be a global accessor to get "the" application object. Ideally, desktop objects would be told (and remember) the application object which created them.
The goal is that -- rather than obtaining anything from global functions or variables -- everything possible is either remembered in a member, or preferably passed directly as an argument. There are a few places where using global accessors is reasonable, but the problem is that in the remaining 95% of cases, they have proven too temping for people to use in place of passing arguments. End result: code becomes untestable and unscriptable.
I don't see a strong case for a context object separate from the application object (yet), but I could forsee us factoring some fields out of the application object in the future depending on what the needs of in-application scripting turn out to be.
-mental