Questions tagged [bond]

Bond is an extensible framework for working with schematized data. It is suitable for scenarios ranging from service communications to Big Data storage and processing.

BOND

Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services.

41 questions
33
votes
1 answer

Difference between Microsoft's Bond and Google's Protocol Buffers

Recently (January 2015) Microsoft open-sourced Bond, their framework for working with schematized data. In many aspects it is similar to Google's Protocol Buffers. What are the biggest differences between the two? What are pros and cons, that is, in…
dtldarek
  • 949
  • 1
  • 13
  • 17
8
votes
1 answer

What do member numbers mean in Microsoft Bond?

Using Microsoft Bond (the C# library in particular), I see that whenever a Bond struct is defined, it looks like this: struct Name { 0: type name; 5: type name; ... } What do these numbers (0, 5, ...) mean? Do they require special…
yuvalm2
  • 866
  • 2
  • 10
  • 27
4
votes
1 answer

Using Microsoft Bond in a C# project

Is there a standard way to reference a Microsoft Bond schema file in a C# project?
yuvalm2
  • 866
  • 2
  • 10
  • 27
3
votes
1 answer

C# Bond: string to wstring

In the Bond C# manual, it notes the following: These following changes will break wire compatibility and are not recommended: Adding or removing required fields Incompatible change of field types (any type change not covered above); e.g.: int32 to…
Joo Wan Ro
  • 33
  • 4
3
votes
2 answers

Microsoft Bond schema evolution best practices

Does Microsoft Bond have some best practices on how schemas evolve over time? I want to make certain we follow best practices such that we have 2 way compatibility (i.e. allowing our Bond types to evolve older versions to the current version, as…
3
votes
1 answer

Representing C# TimeSpan in Bond

Is there an equivalent of C#'s TimeSpan in the Bond type system? If not, how can I interoperate between TimeSpan and a field in a Bond struct?
yuvalm2
  • 866
  • 2
  • 10
  • 27
3
votes
1 answer

Has anyone compared or have any benchmarks of Bond vs JIL for JSON parsing?

BOND is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services. it's…
penderi
  • 8,673
  • 5
  • 45
  • 62
2
votes
1 answer

Cannot serialize a string object with Microsoft.Bond

I am using Microsoft.Bond to serialize a class object which works perfectly fine. However, when I try to serialize a simple System.String object, the CompactBinaryWriter writes almost nothing to the output buffer. I am using this code: string v =…
ameyac
  • 21
  • 2
2
votes
1 answer

How to serialize to a file with Microsoft Bond

The Input and output streams section of the Microsoft Bond documentation provides this sample code to deserialize from a file: using (var stream = new FileStream("example.bin", FileMode.Open)) { var input = new InputStream(stream); var…
Justin Lilly
  • 147
  • 1
  • 9
2
votes
1 answer

Allowing two projects to inherit from the same bond

Using Microsoft Bond in a C# project. Suppose I had a Bond file A used in one project A', and wanted to have two projects B' and C' have Bond files B and C both of which have structs that inherit from a struct in file A. How would I do that? I…
yuvalm2
  • 866
  • 2
  • 10
  • 27
2
votes
2 answers

What are the available datatypes in C# bond?

I'm wondering what is the best way to represent a table that should contain those fields in C# bond format? string FirstName string LastName string Email bool Registered DateTime DateJoined char Gender List Favorites string City string…
Nehad Hazem
  • 59
  • 1
  • 7
2
votes
1 answer

Are Bond field names used in deserialization?

Suppose I serialized a given Bond struct with a single field: struct NameBond { 1: string name; } And then I renamed the field in the .bond file (without changing its ordinal): struct NameBond { 1: string displayName; } Would I still be…
yuvalm2
  • 866
  • 2
  • 10
  • 27
2
votes
1 answer

C# DateTime Serialization with Microsoft Bond

I was replacing internal Serializations in my application from Jil to Bond. I'm switching simple classes with Ms Bond attributes and everything worked fine until I got one with a DateTime. I had then a Dictionary KeyNotFound Exception error during…
Francesco Cristallo
  • 2,856
  • 5
  • 28
  • 57
2
votes
1 answer

Adding new fields to a Bond schema

Suppose I had serialized a given schema A, and then updated it to schema A' by adding a new nullable field X to it. Could I deserialize objects serialized using schema A with schema A'? After deserialization, will the new field have value null?
yuvalm2
  • 866
  • 2
  • 10
  • 27
2
votes
1 answer

How do I correctly use derived classes as fields of a Microsoft Bond object

So there's no confusion, when I talk through my issue I am doing so as someone who is using the compiled classes that result from Bond schemas (that is to say I use "class" instead of "struct", etc.). I feel like it makes more cognitive sense to…
GoodGuyJim
  • 251
  • 2
  • 9
1
2 3