Desktop::Editor and Persist*



Hi miguel,

I've been trying again to redo Desktop::Editor, and I'm having
a bit of a problem getting my mind around some stuff.

You insist Desktop::Editor should simply use PersistFile, and
I just realized that the problem I am/was having with that is
that I am still thinking about it with the old interface in
the back of my mind. I guess the EditorFactory should now
just create a new editor, and then you can tell the Editor
itself to load a file instead of telling the Factory how to
load it, correct?

Probably Desktop::Editor will want to support PersistStream
as well. Suppose a mail-client wants to use Desktop::Editor
to let the user edit the mail. It could create a Stream,
pass that to the editor, and when the user says he wants to
send off the mail, it would have the editor save it to a 
stream again.

So far so good, but what about when you want to change the
contents of a file while it is being edited, say when the
editor is used inside an IDE and you want another part of
the IDE add a function to a file. How do we allow this sort
of behaviour? Should we have the editor also expose a
GNOME::Stream interface of its contents?

Seems like it really isn't all that hard now I have written
it down :) Any comments on this?


cya,
Martijn

P.S. One thing about PersistFile, shouldn't the save method have
some sort of exception to tell you the saving failed?

-- 
Martijn van Beers  <martijn@earthling.net>

'Don't worry if it sounds odd. Believe me, you are talking to
someone who has seen a lot of stuff that is odd. And I don't
mean biscuits.' --- Arthur Dent



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]