Re: import/export interface for Bonobo



Miguel de Icaza <miguel@helixcode.com> writes:

> > 	  I wished to put this in the Persist interface so  that every IO
> > operation had the option of being typed, but I'm now lesss convinced about
> > this. Miguel too doesn't like it since it is not what MS use.
> 
> That was not the reason I did not like it.
> 
> I did not like it because it was bloating an otherwise perfectly clean
> interface.  If an application supports this it seems like it should be
> QI-ied for, and not just aggregated into an existing interface that is
> simple to implement.

Michael cited a good example of where this might be needed. He said
the gnumeric component cannot always tell what type of data is being
fed into its PersistStream interface, because some of the relevant
binary data formats from MS-land do not have magic numbers; only the
structured storage file as a whole (i.e. the thing represented by
PersistStorage, not PersistStream) has a magic number. So the
component cannot definitively determine the type of the data, but the
thing feeding the component can. 

A similar, but less drastic situation: in nautilus we always know the
mime type of the data we are going to feed into a PersistStream
interface before we even ativate the component. It seems wasteful

So it seems to me like the right place to put typing information might
be the Stream interface, not PersistStream. A Stream could have an
optional associated MIME type which the component implementing
PersistStream could check when reading. Typing on an output stream
could be considered purely a hint, perhaps.

I don't think this will complicate implementing PersistStream any, and
in some cases may simplify doing so.

With OAF you can already determine statically what mime types a
component supports (and you really do want to be able to find out
statically; in many cases you want to know _before_ you activate the
component). Perhaps we could separate the types supported for reading
and writing, though.

 - Maciej




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