Re: What ASN.1 got right

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 02, 2021 at 12:14:24AM -0500, Phillip Hallam-Baker wrote:
>                       [...]. I want 'x is an integer' and the only time I
> want to have more information is if x won't fit into 64 bits. Similarly, I

Yes, I agree with this.  Use [u]i[8|16|32|64] to indicate the expected
range of integers that aren't arbitrarily large, and make the name of
the large integer type denote as much so that it's not used accidentally
instead of machine word sized integer types.

If an integer really is expected to do something like express named
versions, then sure, name the valid values.

> don't want the schema to say '2 to 6 objects of type foo', the minimum
> number of entries in a list is always either 0 or 1 and the maximum is
> always 1 or infinity. Nothing else is needed at the schema layer. If you
> have detailed data constraints you can always apply them later.

Indeed.

This is true for database schemas too.  Cardinality is always one of
zero-or-one, zero-one-or-many, one, or one-or-many.  Simpler that way.

ASN.1 is _too_ expressive in this regard, I agree, though one does not
have to use its full range of expressivity.

Nico
-- 




[Index of Archives]     [IETF Annoucements]     [IETF]     [IP Storage]     [Yosemite News]     [Linux SCTP]     [Linux Newbies]     [Mhonarc]     [Fedora Users]

  Powered by Linux