Comment #4 on issue 249 by osfan6313: Default values are not assumed to be filled in.
http://code.google.com/p/protobuf/issues/detail?id=249

We're using protocol buffers to store user settings, so we want some fields to be required(for data validation purposes). However, when we first generate the data we want there to be some default value for these settings, so that we can have default settings already filled in automatically.

I could be wrong, but I think that even if I made the field 'optional', and immediately built the protocol buffer, no information would be set by default.

Or, to put it another way:
When making a protocol buffer, you don't always want ALL fields to be set, however some fields MUST have a value. If no user-value is defined, then the default value is used for that field. For example, if you use a JOptionPane to show the user some information, you don't always want to give the user OK and Cancel buttons, because they're not relevant. However, you always have a Component and a Message as parameters. If nothing else is provided, then the defaults for the other settings(icon, title, ok/cancel) buttons are set to the default(none).

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to