["preserve-slice"] and Ice.Default.SlicedFormat=1

in Help Center
Hello,
for slice preserving it is stated in the documentation (see link) that each operation needs to have the metadirective format:sliced attached to it.
Is this also the case if the property Ice.Default.SlicedFormat=1 is used?
thanks
Mirko
for slice preserving it is stated in the documentation (see link) that each operation needs to have the metadirective format:sliced attached to it.
Is this also the case if the property Ice.Default.SlicedFormat=1 is used?
thanks
Mirko
0
Comments
As stated in the documentation of the format metadata, the value of Ice.Default.SlicedFormat is used if no format metadata is specified. So you don't need to set format:sliced if you set Ice.Default.SlicedFormat=1.
You are still required to set the preserve-slice metadata on a base class if you want to be able to preserve the slices. If you don't specify this metadata and you receive an object that needs to be sliced, the slices won't be preserved. This is fine if you don't need to forward the object to another peer but if you want to forward it as-is, you'll want to preserve its slices.
Cheers,
Benoit.
Do I need to specify the preserve-slice in a class that has no classes it inherits from or can it be some class in the middle of the inheritance?
An example to clarify:
It don't need the preserving for all classes that inherit from A, only all classes that inherit from B.
Does this work or does class A need to have the tag ["preserve-slice"]?
It also works for objects which are nested within another data type, the object of type B will be sliced and its slice will be preserved when it's forwarded to another peer even if the object B is nested in the class D.
Cheers,
Benoit.