Code Monkey home page Code Monkey logo

Comments (3)

sapek avatar sapek commented on August 12, 2024

Are you thinking about compatibility of serialized data?

For binary formats names don't matter, so changing a name is not a breaking change.

Obviously changing names may be a breaking change for text protocols like JSON and Xml. Struct names usually don't matter (an exception is Xml with namespaces) but renaming a field is always a breaking change. SimpleJSON protocol allows you to remap field names using JsonName attribute, e.g.:

struct Record2
{
    [JsonName("Name")]
    0: string FirstName;
}

from bond.

donners77 avatar donners77 commented on August 12, 2024

Thank you.

Yes, I was thinking about the compatibility of serialized data.
I was also thinking about what facilities are available for dealing with changes in schema.

From reading the "Young Person’s Guide to C# Bond" I noticed there is:

  • polymorphism (if new fields are added)
  • converters (for changing the data type of a field)

Are there any other facilities for compatibility / conversion as schema is modified over time?

from bond.

sapek avatar sapek commented on August 12, 2024

The best practice is to only make non-breaking schema changes (adding/removing optional fields) and then, in general, you don't have to do anything to handle schema changes. This is because with non-breaking changes Bond is forward and backward compatible, i.e. old code can read new data and new code can read old data.

Changes which are breaking and thus should be avoided are adding/removing required fields and changing changing type or default value of an existing field. Also adding additional bases to existing inheritance hierarchy is a breaking change (you can of course derive additional schemas from existing ones w/o breaking anything).

from bond.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.