Re: typed BonoboStreams



> 	Furthermore, I don't think there is a need for a 'get' function,
> since in the absence of a 'set' [ which you would do anyway ] the type
> used will be the default [ ie. the first item from the get_types ].

But you can only do get_type when you're saving. The persistor would
use "get" when it was loading, to find out what type of data the other
end was sending if it didn't have magic numbers.

> 	I think then, that perhaps the best way to do this, is all in the
> Persist Interface, thus:
> 
> 		void save (in Bonobo::Stream stream,
> 		           in Bonobo::StreamType type);
> 
> 		void load (in Bonobo::Stream stream,
> 		           in Bonobo::StreamType type) raises (WrongDataType);

Sure, that works great. (but wouldn't save need to be able to rause
WrongDataType too, in case the caller was dumb and passed an invalid
type?)

> 	I also tend to think that it is wise to have a typedef for this
> string.

Sure. I'd still be happier with "ContentType" or something though.

(I'm going to be gone this weekend, so this is my last comment on the
thread until Monday.)

-- Dan




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