AqlaSolutions / AqlaSerializer

Binary serializer with full .NET support!
http://www.aqla.net
Other
17 stars 3 forks source link

Does the order of adding types to type model matter? #60

Open inethui opened 3 months ago

inethui commented 3 months ago

Hi,

I'm trying to programmatically register (add) types to Aqla type model.

Does the addition order matter? Would it be problem if the serialization uses a model with types registered in one order, but the deserialization uses a model with the types registered in a different order?

Thanks

AqlaSolutions commented 3 months ago

Hi, the order of fields registration does matter when tags (field numbers) are assigned automatically. If you specify tags during fields registration, then the order doesn't matter.

AqlaSolutions commented 3 months ago

Sorry, I misunderstood you. The order of adding types matters mostly only for automatic inheritance handling. If you set tags for derived types manually, then the order shouldn't be relevant.

AqlaSolutions commented 3 months ago

See also https://github.com/AqlaSolutions/AqlaSerializer/wiki/Batch-types-registration