Re: Desktop::Editor and Persist*




> 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. 

Well, ideally it will support PersistFile and PersistStream.

> 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?

yes.

> 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?

Mhm, this actually sounds like a good idea. I had not thought of this
bfore.

Perhaps you want this:

module Desktop {

       interface Editor {
		 ...
		 GNOME::Stream access_as_stream ();	
	};
};

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

Good thinking.  Yes, it should.

Miguel.



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