|
|
|
|
|
by sapek
4091 days ago
|
|
Bond has 3 ways of working with serialized payloads: 1) Simple deserialization where an object is fully materialized. This is the simplest (you write your business logic against idiomatic types in your target language) but, as you note, might not be best from performance perspective in some scenarios. 2) Lazy deserialization at the level of nested structs via bonded<T> [1]. In many cases this allows to optimize performance if you don't need to materialize the whole object but w/o loosing much in terms of simplicity of the programming model. 3) Transforms [2]. This is a very generic and very powerful abstraction in Bond. All higher level APIs like serialization and deserialization are internally implemented using this mechanism (even Python bindings [3] are fully implemented on top of Bond C++ meta-programming infrastructure driving Boost Python). In C++ it is built using template meta-programming and in C# using LINQ expressions. In Both cases it is a little like having a generic, strongly typed parser for richly typed data. [1] https://microsoft.github.io/bond/manual/bond_cpp.html#unders... [2] https://microsoft.github.io/bond/manual/bond_cpp.html#transf... [3] https://microsoft.github.io/bond/manual/bond_py.html |
|