Actually protobuf-net and proto# both gives you the choice to do something like this: (Annotations omitted for brevity)
interface IFrozenYoghurt { public string Name { get; } }
class Yoghurt : IFrozenYoghurs{ public string Name { get; set; }
And thus giving you the option to pass around the immutable/frozen interface to clients when such semantics are needed.
True, it's also fairly trivial to generate the popsicle immuatability classes given an "IFoo".
And yes, it's not truly immutable anyone having a "Yoghurt" refrence would be able to change stuff, but's that a bit like protecting from machivelli if our dataaccess component only gives out refrences to the frozen interface we *should* be safe. Anyone starting to cast villy nilly just to break things is just as proabable to bring out the reflection hammer and and write directly to our private "bar" field.
I assume the car object in your example is a builder?
Because
otherwise it would have been the same as if the setter(s) for the data
object for car is exposed directly. I still think optionally exposes
the setters for the data objects is a simpler and safe solution, The
architect of the system can always mandate the protocol buffer data
objects to be immutable - if doing so leads to a more stable system :)