Show / Hide Table of Contents

Interface IEvolvableObject

Defines an interface that should be implemented by the classes that want to support evolution.

Namespace: Tangosol.IO.Pof
Assembly: Coherence.dll
Syntax
public interface IEvolvableObject

Methods

GetEvolvable(int)

Return IEvolvable holder object for the specified type id.

Declaration
IEvolvable GetEvolvable(int nTypeId)
Parameters
Type Name Description
int nTypeId

Type id to get IEvolvable instance for.

Returns
Type Description
IEvolvable

IEvolvable instance for the specified type id.

Remarks

This method should only return Evolvable instance if the specified type id matches its own type id. Otherwise, it should delegate to the parent:

// assuming type ID of this class is 1234 private IEvolvable evolvable = new SimpleEvolvable(1234); ... public IEvolvable GetEvolvable(int nTypeId) { if (1234 == nTypeId) { return this.evolvable; }
    return base.GetEvolvable(nTypeId);
}

GetEvolvableHolder()

Return EvolvableHolder that should be used to store information about evolvable objects that are not known during deserialization.

Declaration
EvolvableHolder GetEvolvableHolder()
Returns
Type Description
EvolvableHolder

EvolvableHolder instance.

Remarks

For example, it is possible to evolve the class hierarchy by adding new classes at any level in the hierarchy. Normally this would cause a problem during deserialization on older clients that don't have new classes at all, but EvolvableHolder allows us to work around that issue and simply store type id to opaque binary value mapping within it.

In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.