Yet none of these defines an applicable range. What that means is that
negative values would be valid as well according to the draft even if they
made no sense at all. In fact for the Pieces length this is probably not the
case as the description in the draft should be enough to provide a positive
range.
So in my opinion we should either add a range or change them to one of the
unsigned PODS. In that case we still have to define that 0 is not to be used
for pirority.
In terms of priority I would opt for a range as imo a priority of 268435456
would rather be confusing if it was also shown to the user not just used
internally. We could use xsd:unsignedByte for example, when we would have only
positive values and automatically a range (if we exclude 0 in fact) from 1 to
255.
What do you think on that?
Cheers,
matthias
IIRC, XSD has different types for "positive" and "nonnegative". The former
doesn't include 0.
"The value space of xsd:positiveInteger includes the set of the strictly
positive integers (excluding zero), with no restriction of range."
As such there is no integer-type (here in informatics) that could support the
possible range. Thus I'm still for setting a fixed maximum, so that implentors
of Metalink can be sure that any valid number will work with their used data-
type and not result in an integer overflow.
[1] As this should not be a problem with sane users
[2] http://books.xmlschemata.org/relaxng/ch19-77279.html see "Description" and
"Example"
> so, you proposed a range of 1 to 255...
>
> any objections or other suggestions? :)
Regarding metaurl and url, doesn't this effectively limit the number
of (ordered) metaurls/urls to 255? This would seem like an arbitrary -
and needless- restriction to me. There should be no reason why the
specification should forbid 1000 urls that are all ordered, which
could be a valid use case, for whatever reason. I agree that the spec
should be definite, but it shouldn't put up restrictions that are not
needed I think. If limiting the numbers, I'd suggest a reasonably
large range that matches a commonly used datatype, like a short int
(16-bit) or an int (32-bit), which would leave ample room (one would
think).
However, the spec doesn't give any guidance yet about the use case of
the priorities. The use case we have in mind is that we start with 1
(highest priority) (where we started with 99 in the past and counted
in the opposite direction), and then increment the value, right? That
could be made explicit (although there doesn't need to be a
requirement about fixed increments either). Anyway, the relative
difference of the priorities is what matters. Maybe an alternative to
defining a fixed a range could be to describe a suggested usage;
because if people start counting at 1 and use increments of 1, and not
10 or 100 (which they might happen to do), the chances of hitting
funny limits would be much higher.
Even _if_ specifying a range, it might be useful to suggest the
following: a client that can process datatypes only of a certain size
might ignore those entries that come with a higher (larger number)
priority than whatever their implementation choses to being unable to
process. Does this make sense? Or am I crazy? :-)
Altogether, I think it would be useful if the spec suggests to start
counting at 1, increment in steps of 1, _in_order_to_ decrease the
chances that any potential client might run into a limit. A client
should support at least priorities to 255 (absolute minimum), but
better one byte more ;-)
Well, it's just my opinion.
Difficult matters. One should have more experience in protocol design ;)
Peter
You can have an unlimited number of urls as they can have the same priority.
So there is no reason why you should always increment with 1. Additionally
there is no definition of how the relative difference is to be treated. That
is all up to the application developers.
What you should also keep in mind is that locations can be defined. In case
you have 10 urls with the same priority you could still rank them more finely
if locations are specified.
Btw. for 3.0 2nd ed it was 100 to 1 so you could have started with 99. ;)
The range 1-255 I suggested was just a number that matches a datatype
(unsigned char).
matthias
Yes - that's why I wrote "ordered". Maybe it wasn't clear enough,
sorry: I was referring *only* to the number of URLs with differing
priority, not to the number of URLs with identical priority, the
latter is obviously not limited by the range.
> So there is no reason why you should always increment with 1.
I'm not sure how you meant that - if you say, there's no reason to
always increment at all, I have to say that I have to in most cases,
if I want to create an ordered list within a country. (And there are
also quite many countries.) There's a practical use case that I have
in mind, it's not made up or academical - I certainly hope that the
number of openSUSE mirrors grows by a factor of 2 or more in the
coming years, although I don't know if it will happen.
If you rather meant "no reason why you should use increments as small
as 1", then I'd counter that a small range of 1-255 would be a very
good reason to prefer small increments over larger ones... ;-)
Surely I wouldn't want to see a limit of 255 priorities.
It's not that I don't like the idea of the definition as such, and the
binding & clarity that it brings, it's just that I would either make
it bigger or be less limiting.
> Additionally
> there is no definition of how the relative difference is to be
> treated. That
> is all up to the application developers.
>
> What you should also keep in mind is that locations can be defined.
> In case
> you have 10 urls with the same priority you could still rank them
> more finely
> if locations are specified.
>
> Btw. for 3.0 2nd ed it was 100 to 1 so you could have started with
> 99. ;)
>
> The range 1-255 I suggested was just a number that matches a datatype
> (unsigned char).
>
> matthias
Thanks for discussing this interesting point!
Peter