Re: [boost] [serialization] exception-safety of container-serialization

----- Mensaje original ----- De: Thorsten Ottosen <tottosen@dezide.com> Fecha: Sábado, Febrero 18, 2006 1:17 am Asunto: Re: [boost] [serialization] exception-safety of container-serialization
David Abrahams wrote:
Joaquín Mª López Muñoz <joaquin@tid.es> writes:
2. It might be of interest to keep a partially recovered object. For instance, think of the situation in which a container is being marshalled thru a socket and you lose internet conectivity.
That brings up an interesting point: you have to make sure, when writing deserialization for a class, that partial deserialization won't leave its instances with broken invariants.
Well, can't we think if deserialization as just another way of constructing an object?
So if deserialization fails, it's like when construction fails and you might throw or abort. No?
No, IMHO. There's a crucial difference with failed construction: if a ctor fails the object does not even come into existence. When loading fails, the object into which the loading process was performed exists and should at least honor its invariants. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
participants (1)
-
JOAQUIN LOPEZ MU?Z