Browse by Tags

All Tags » CSharpDevCenter » C# » Protocol Buffers (RSS)

Mapping from a type to an instance of that type

A question came up on Stack Overflow yesterday which I've had to deal with myself before now. There are times when it's helpful to have one value per type, and that value should be an instance of that type. To express it in pseudo-code, you want...

Lessons learned from Protocol Buffers, part 4: static interfaces

Warning: During this entire post, I will use the word static to mean "relating to a type instead of an instance". This isn't a strictly accurate use but I believe it's what most developers actually think of when they hear the word. A...

Lessons learned from Protocol Buffers, part 3: generic type relationships

In part 2 of this series we saw how the message and builder interfaces were self-referential in order to allow the implementation types to be part of the API. That's one sort of relationship, but in this post we'll see how the two interfaces relate...

Lessons learned from Protocol Buffers, part 2: self-referential generic types

In the first part of this series we saw that a message type and its builder are closely related. The tricky bit comes when we want to define an interface describing messages and builders. Although some members clearly depend on the data being built (the...

Lessons learned from Protocol Buffers, part 1: messages, builders and immutability

My port of the Protocol Buffers project has proved pretty interesting. I thought I'd share some of the lessons I've learned along the way, as well as some of the frustrations at concepts I still can't express in C#. This was originally all...