RE: [AD] user data

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Title: RE: [AD] user data

> But how do you define "the user"? Especially when addon packages
> are providing additional widget types, there can easily be three
> different people all fighting over the same fields (future versions
> of Allegro, the addon author, and the client program itself).
> The situation could be even worse if one addon package was built
> over the top of another!

I'd say that if your code is meant to be used by some other code
(at the source level), then do not use the user field. A hash table
to store any number of hooks would have the disadvantage of taking
up memory, and probably require additional memory chunks (besides
the actual data stored, which might be some extra memory chunk by
itself). Your point is valid, as always, but I'd draw a line between
the ability to attach one bit of info and the total flexibility of
being able to attach any number of them. That's somewhat arbitrary,
though, I agree.
BTW, future versions of Allegro would be explicitely forbidden to
use such a field, since they have the advantage of being able to
easily add yet another field if needs be :)

--
Vincent Penquerc'h



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/