XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] It is okay for things to break in the future!

> 
> But if there is a bit in your code where there is effectively a queue (I'm struggling to find a good concrete example here), you might decide to implement the queue insertion with what is effectively a O(N^2) algorithm, because it's bulletproof, and N is never going to be more than a few.  The argument is saying 'Go ahead and do that -- don't beat yourself up -- _but_ it would be wise to think briefly about how big N can be, and wise to fix N, and to ensure the program deliberately fails with 'rewrite me!' when that limit is breached.'
> 

There are certainly cases where I decide to to assume that the number of attributes or in-scope namespaces on an element will usually be small enough that a quadratic algorithm is OK. But I certainly wouldn't use that as justification for putting an arbitrary limit of (say) 16 on how many attributes or namespaces you can have.

On the other hand, you do sometimes need to impose limits, e.g. a limit of 65536 on the number of distinct namespace URIs in a document. If you've decided that there are good engineering reasons for imposing such a limit, then fine, you need to fail cleanly if they are exceeded, and if that's done using schema validation, that's fine too. But that's a very different matter from imposing a limit of 16 because that's the most we've ever seen or the most we can imagine anyone wanting. 

Michael Kay
Saxonica



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS