[Y-devel] Y-Protocol proposal, again :-)

Maurice van der Pot griffon26 at kfk4ever.com
Tue Apr 13 16:53:38 BST 2004


On Tue, Apr 13, 2004 at 11:23:41AM -0400, Kris Van Hees wrote:
> The one major disadvantages to using values for events/messages is that you
> make the assumption that both server and client will indeed *NEVER* renumber
> anything.  

Correct. The same holds for strings, they shouldn't change names.

> That is all fine, if you work with definition files that associate
> the values with meanings *AND* put the rule in place that no value will ever
> be reused.  That usually results in a very messy file that needs a text editor
> search if you look for the code for a certain message because, well, you cannot
> depend on any order.  

You can reshuffle the messages in that file around as much as you like
as long as the value is determined by the line itself and not its 
position (so use #define's or use explicit values if you use an enum).

> No big deal, though.  Until someone decides that cleaning
> up that file really should be done (but it won't be possible), 

Why wouldn't that be possible with explicit values?

> or when someone
> feels that (either for easthetic reasons, or for actual design reasons) a block
> of values should be set aside for a certain module, to be used at will.  Which
> means you will lose in the end, because assigning actual semantic meaning to
> arbitrary values is *BAD*.

If you want to group messages, use group numbers in addition to message
numbers. Don't force them into one value and you'll be fine.

> I'm not saying that going with pure values is a bad idea, but we need to have
> a total commitment that values will be assigned from either 0 or UINTMAX, with
> no gaps, and whenever a value is no longer needed, the value is *LOST*, so
> that it is guaranteed that values will never, ever be reused.  Even if it seems
> a good idea, or what e.g. with a major release, clients and servers should be
> back in sync, and thus renumbering seems possible.  Just never do it :)

If you have 4G message values to choose from, losing some is acceptable.

Maurice.




More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved