Kyle Lieber.
algumas coisas pelas quais eu senti escrever.
Estratégia de versão do Maven.
Eu tenho tido muitas discussões com analistas da minha organização sobre como o software de versão usando Maven e I & rsquo; achar que há um equívoco comum sobre o que realmente significa SNAPSHOT. Eu estava procurando um bom blog para enviá-los que ajude a explicar o controle de versão em Maven, mas infelizmente tudo que eu encontrei apenas discute formatos de versão e não como usá-los como você está desenvolvendo um aplicativo. Então, eu decidi que eu tomaria uma facada nisso. Congratulo-me com quaisquer comentários e críticas construtivas que me ajudem a melhorar este documento, então fique à vontade.
Primeiro, um SNAPSHOT não é o mesmo que uma versão alpha / beta / etc. É uma palavra-chave especial que significa que é a versão mais recente do seu código. Isso significa que ele muda. Se você derrubou o someapp-1.0-SNAPSHOT ontem e então você tenta retirá-lo hoje, provavelmente não será o mesmo. Isso também significa que se você tiver um projeto dependente de uma versão do SNAPSHOT, o maven precisará verificar o repositório remoto para as mudanças sempre que você executar uma compilação.
A próxima coisa a entender é qual é a versão em Maven. Uma versão não significa que a versão esteja pronta para a produção. Isso significa que o desenvolvedor decidiu que ele está em um ponto em seu desenvolvimento que ele quer que o código seja bloqueado para que não seja perdido. Ele também pode querer distribuir esse código para alguém, talvez seja uma biblioteca, um desenvolvedor em outra equipe precisa começar seu próprio desenvolvimento de aplicativos ou talvez seja um aplicativo que será instalado em um ambiente de teste para testes. Então, isso significa que uma versão do maven pode ser um alfa, beta, candidato a liberação, patch, produção ou qualquer outra coisa que você deseja categorizar.
Faz sentido? Bem, talvez passar por um cenário de como eu lido com isso o ajudaria. Primeiro, olhe para a estratégia de versão que uso:
Estratégia de versão.
A sintaxe para esta estratégia é baseada no formato em Maven: The Complete Reference. As diferenças são I & rsquo; m rename & ldquo; incremental version & rdquo; para & ldquo; patch & rdquo; e quebra o opcional & ldquo; qualifier & rdquo; em & ldquo; type & rdquo; e uma & ldquo; tentativa & rdquo; simplesmente por clareza.
& lt; major & gt; - Este é um número que indica uma mudança significativa no aplicativo. Uma versão importante talvez seja uma reescrita completa da versão principal anterior e / ou quebra a compatibilidade com versões anteriores. & lt; minor & gt; - Este é um número que indica um pequeno conjunto de alterações da versão secundária anterior. Uma versão menor geralmente consiste em um conjunto uniforme de correções de bugs e novos recursos e deve sempre ser compatível com versões anteriores. & lt; patch & gt; - Este é um número que indica que foram corrigidos alguns erros que não podiam esperar até a próxima versão menor. Uma versão de patch só deve incluir correções de bugs e nunca incluir novos recursos. Também deve ser sempre compatível com versões anteriores. As correções de segurança são um exemplo de um patch típico. [& lt; type & gt; - & lt; tentativa & gt;] - Esta última parte é opcional e usada apenas para identificar que esta versão não é necessariamente estável. O tipo é uma palavra-chave e pode ser qualquer coisa, mas geralmente aderem a alpha, beta e RC. A tentativa é apenas um número para indicar qual tentativa desse tipo é essa. Então, por exemplo, beta-01, RC-02, RC-05, ect. Para uma versão estável, deixo essa parte, no entanto, eu vi outros projetos que gostam de usar a palavra-chave de RELEASE para indicar a versão estável (você deixa a tentativa, porque isso não faria sentido, use RC (lançamento candidato) para isso).
Exemplo Scenerio.
Então, agora, para o cenário. Deixe-nos dizer que eu estou trabalhando no aplicativo Foobar. Minha organização está esperando que eu entregue a versão 1.0 do foobar no final do trimestre. (Observe que eu digo 1,0, o que significa que eu só uso os dois primeiros números para se referir à versão. Isso ocorre porque a versão maior e menor são realmente as únicas versões em que qualquer pessoa se importará além do seu time de desenvolvimento. Além disso, não há caminho para eu saber qual será a versão final, mas eu sei que o maior e o menor permanecerão o mesmo.) Eu estou trabalhando em uma equipe ágil, então eu vou implantar tudo o que eu fiz no final de cada sprint para o meu ambiente de teste para que meus testadores possam validar tudo. Então, aqui é o que eu posso fazer:
Vou começar com a versão 1.0.0-SNAPSHOT no meu pom. xml no início do Sprint # 1. No final do Sprint # 1, vou usar o plugin maven-release para criar a versão foobar-1.0.0-RC-01 da aplicação Foobar. O plugin irá mudar a versão de 1.0.0-SNAPSHOT para 1.0.0-RC-01, marcar o código em scm com foobar-1.0.0-RC-01 e, finalmente, criar essa versão. Em seguida, o plugin irá atualizar o tronco para ser a próxima versão de desenvolvimento do aplicativo que iremos em 1.0.0-SNAPSHOT. Então eu vou implantar o foobar-1.0.0-RC-01 para o ambiente de teste. Este processo continuará para os próximos sprints até chegarmos a uma fase em que estamos a um ponto em que pensamos estar completo.
Então, deixe-nos dizer que estamos agora na Sprint # 5. Nós lançamos quatro versões de candidatura de lançamento do aplicativo, corrigindo erros e adicionando recursos ao longo do caminho. Agora nos sentimos foobar-1.0.0-RC-04 está pronto para uso em produção. Agora eu lanço o maven-release-plugin novamente para criar a versão foobar-1.0.0 do meu aplicativo. Mais uma vez, o plugin irá marcar a versão atual do código no scm com foobar-1.0.0 e, em seguida, construir essa versão. O plugin então atualizará o tronco para ser a próxima versão de desenvolvimento do aplicativo que desta vez eu escolho ser 1.1.0-INSTANTÂNEO.
Aviso, incremento a versão menor e não a versão do patch. Em um mundo perfeito, eu seria feito com a versão 1.0, mas é claro que isso não é um mundo perfeito e, provavelmente, I & rsquo; eu tenho que corrigir minha versão 1.0.0 em algum momento. Como eu não sei quando isso será, eu vou seguir com a vida e começar a trabalhar na próxima versão do aplicativo, 1.1.
Algumas semanas depois, minha equipe de QA me informa que um erro foi encontrado nos testes de lançamento que precisam ser corrigidos. O que vou fazer agora? I & rsquo; ve movido e tem novo 1.1 código no tronco que pode & rsquo; t entrar na versão 1.0. Sem preocupações, lembro que o plugin de lançamento marca cada um dos meus lançamentos para mim. Então, eu crio um ramo da tag foobar-1.0.0 e chama foobar-1.0.X. Em seguida, marquei o novo ramo e incremente a versão do patch para 1.0.1-SNAPSHOT. Este novo ramo é agora meu ramo de remendo. Eu corrigirei o bug relatado pela equipe de QA e use o plugin de lançamento para produzir a versão de patch foobar-1.0.1. Então, imediatamente depois de produzir foobar-1.0.1, mesclaremos as alterações 1.0.1 no tronco para que a correção esteja presente na versão 1.1 (que ainda não foi lançada).
Então respiro fundo e volto a trabalhar no 1.1. Se surgir outro erro, talvez, mesmo depois de sairmos à produção, vou continuar a voltar ao meu ramo de remendo foobar-1.0.X para fazer a correção e mesclar as mudanças de volta ao tronco.
Estratégia simplificada.
Eu não uso sempre a estratégia acima. Na verdade, muitas vezes eu uso o que eu chamaria de versão simplificada desta estratégia. Essencialmente, é a mesma coisa, exceto que eu removo o - & lt; type & gt; - & lt; tentativa & gt; completamente e em vez de um & lt; patch & gt; , Eu tenho um mais genérico & lt; incrementalVersion & gt; (assim como no livro maven). Então, parece assim:
Deixe o & rsquo; s voltar para o cenário de exemplo acima e compare a estratégia completa com esta estratégia simplificada:
Como você pode ver, a estratégia simplificada perde uma parte da verbosidade da estratégia completa que pode ser uma coisa boa e ruim. Não será óbvio se uma versão está pronta para a produção ou apenas um candidato a liberação. No entanto, isso significa que você não precisa testar o candidato de lançamento aceito duas vezes. Se você notou, a versão fornecida pela Sprint # 4 também é a versão de produção. Não há necessidade de reconstruí-lo apenas para remover o - RC-04.
Para uma equipe menor ou uma equipe que não tem realmente seus artefatos consumidos por muitas outras áreas, esta pode ser uma solução melhor porque há muito menos versões para gerenciar. Você só precisa se certificar de que está se comunicando claramente com sua equipe para que todos saibam o que está acontecendo.
Postagens recentes.
GitHub Repos.
Atualização do status. @klieber no GitHub.
Direitos autorais e cópia; 2018 Kyle Lieber - Licença - Desenvolvido pelo tema Hugo e Hugo-Octopress.
Documento não encontrado.
Desculpe, o documento solicitado não está disponível. Aqui estão alguns passos que você pode tentar encontrar a página que você estava procurando:
Se você digitou o URL manualmente, certifique-se de que é exatamente como deveria. Verifique também a capitalização e que você está usando barras oblíquas (/). Se você está procurando informações sobre um assunto em particular, comece na página inicial do W3C ou no Mapa do site. Tente pesquisar o site usando a caixa de pesquisa no topo desta página.
A FAQ do W3C Webmaster responde às perguntas mais frequentes sobre o nosso site.
[Draft Editorial] Extensão e Versões de Idiomas: XML Languages.
Draft TAG Finding 04 July 2007.
Este documento discute os aspectos relacionados ao XML do controle de versão. Ele descreve a terminologia baseada em XML, tecnologias e estratégias de controle de versão. Ele fornece exemplos de Esquema XML para cada uma das estratégias e discussão sobre vários padrões de projeto de esquema. Uma série de linguagens XML, incluindo XHTML e Atom, são usadas como estudos de caso em diferentes estratégias.
Status deste documento.
Este documento foi desenvolvido para discussão pelo W3C Technical Architecture Group. Ainda não representa a opinião consensual do TAG.
A publicação deste achado não implica o endosso da adesão do W3C. Este é um documento preliminar e pode ser atualizado, substituído ou obsoleto por outros documentos a qualquer momento.
Achados adicionais de TAG, ambos aprovados e em estado de rascunho, também podem estar disponíveis. O TAG espera incorporar esta e outras descobertas em um Documento de Arquitetura da Web que será publicado de acordo com o processo da W3C Recommendation Track.
Envie comentários sobre esta descoberta para a lista de endereços do TAG com arquivamento público www-tag @ w3 (archive).
Índice.
1. Introdução.
Extensão e versão de idiomas XML A Parte 1 descreveu os idiomas de extensão e de versão. A Parte 2 centra-se em XML e inclui aspectos específicos de linguagem de esquema de extensão e versão XML. As escolhas, decisões e estratégias descritas na Parte 1 são aumentadas com instâncias XML e XML Schema aqui.
1.1 Terminologia XML.
Descreveremos alguns refinamentos chave para a nossa terminologia de versão para XML. Uma linguagem XML tem um vocabulário que pode usar termos de um ou mais namespaces XML (ou nenhum), cada um dos quais tem um nome de espaço para nome. [Definição: Uma linguagem XML é uma onde todos os Textos DEVEM ser XML bem-formado.]. Como XML é uma linguagem de marcação, as partes mais significativas de XML Languages são os elementos e atributos. [Definição: Um componente é um elemento ou atributo XML.] O Idioma de Nome - composto por nome, dado, termos familiares - possui um espaço para nome para os termos. Usamos o prefixo "namens" para se referir a esse namespace. O Idioma do Nome pode consistir em termos de outros vocabulários, como Dublin Core ou UBL. Esses termos cada um têm seus próprios espaços de nome, ilustrando que um idioma pode ser composto de termos de vários namespaces. Um namespace XML é um contêiner conveniente para coletar termos que se destinam a ser usados em conjunto dentro de um idioma ou entre idiomas. Fornece um mecanismo para criar nomes únicos globalmente.
Usamos o termo instância ao falar de seqüências de caracteres (aka texto) em XML. [Definição: Uma instância é um texto de XML bem formado e os textos geralmente são limitados por um idioma de esquema.] O idioma do esquema pode ser processável pela máquina, como DTDs, XML Schema, Relax NG, ou o idioma do esquema pode ser legível por humanos texto. Os documentos são instâncias de um idioma. Em XML, eles devem ter um elemento raiz. Um texto de nome pode ter um elemento de nome como elemento raiz. Alternativamente, o vocabulário de nomes pode ser usado por outro idioma, como ordens de compra para que os textos do pedido de compra possam conter textos que possam ser considerados nomes de texto. Assim, as instâncias de um idioma XML são sempre pelo menos parte de um texto e podem ser o texto inteiro. As instâncias XML (e todas as outras instâncias de linguagens de marcação) consistem em marcação e conteúdo. No exemplo do nome, os elementos dados e familiares, incluindo os marcadores finais, são a marcação. Os valores entre os marcadores inicial e final são o conteúdo. Uma instância possui um modelo de informação. Há uma variedade de modelos de dados dentro e fora do W3C, e o padronizado pelo W3C é o informativo XML.
Os termos relacionados ao XML e seus relacionamentos são mostrados abaixo.
ednote: Atualização para a versão final da terminologia.
Alguns exemplos de consumidores e produtores de XML são: um processador de folha de estilo é um consumidor do texto XML que está processando (o produtor não é mencionado); No contexto dos serviços da Web, os papéis do produtor e do consumidor alternam à medida que as mensagens são passadas para frente e para trás. Observe que a maioria das especificações do serviço da Web fornecem definições de entradas e saídas. Por nossas definições, um serviço da Web que atualiza seu esquema de saída é considerado um novo produtor. Um serviço da Web que atualiza seu esquema de entrada é um novo consumidor.
1.2 Tipos de linguagens XML.
Em última análise, existem diferentes tipos de linguagens XML. As abordagens de versão e as estratégias apropriadas para um tipo de linguagem podem não ser apropriadas para outro. Entre os vários tipos de vocabulários, encontramos:
Nomes Justos: algumas línguas na verdade não identificam elementos ou atributos; Eles são apenas listas de nomes. O uso do QNames para identificar palavras no banco de dados do WordNet, por exemplo, ou os nomes das funções e operadores no XPath2 são exemplos de idiomas "apenas nomeados".
Autônomo: idiomas concebidos para serem usados mais ou menos por si mesmos, por exemplo, XHTML, DocBook ou TEI.
Recipientes: idiomas projetados para ser usados como wrapper ou framework para algum outro idioma ou carga, por exemplo, SOAP ou WSDL.
Extensões de recipiente: idiomas projetados para ampliar ou aumentar uma determinada classe de contêiner. As especificações que estendem o SOAP, definindo blocos de cabeçalho SOAP, por exemplo, para fornecer segurança, sincronização ou mensagens confiáveis são exemplos de idiomas de extensão de contêiner.
Existem alguns tipos de linguagens de extensão XML, extensão de elemento e extensão de tipo ou atributo.
Extensão de elemento. Idiomas que são elementos. SOAP, etc. são extensões de elementos.
Atributo ou Tipos. Idiomas que definem tipos ou atributos. Esses idiomas devem existir no contexto de um elemento que não é definido pelo idioma. Às vezes, chamados de "parasitas", pois exigem um elemento "host". XLink é um exemplo.
Misturas: idiomas concebidos para, ou frequentemente utilizados, encapsulando algumas semânticas dentro de outro idioma. Por exemplo, MathML pode ser misturado dentro de outro idioma.
Esta não é de maneira alguma uma lista exaustiva. Nem estas categorias são completamente claras. MathML pode certamente ser usado autônomo, por exemplo, e idiomas como SVG são uma combinação de autônomos, recipientes e misturas.
2 requisitos de idioma XML.
As questões gerais de linguagem descritas nos Requisitos da Parte 1 (.../versioning#requirements). Esses requisitos são aumentados em XML por:
Precisão do XML Schema para as versões do idioma. Por precisão, queremos dizer o grau em que a linguagem é descrita. Veremos como alguns projetos impedem a descrição completa do esquema XML. Muitas vezes isso resulta em esquemas que estão incompletos na primeira e nas versões subsequentes. As opções são tipicamente: Complete em todas as versões, completa apenas na primeira versão, incompleta em todas as versões.
Uso de ferramentas genéricas de XML e de espaço para nome (impedindo versões específicas de vocabulário). Este é um trade-off porque algumas ferramentas XML genéricas (como XPath) são mais difíceis de usar com vários namespaces contendo a mesma "coisa", como o elemento P do XHTML.
3 tecnologias de identificação de versões.
A identificação das versões de elementos e atributos muitas vezes é uma parte importante do processamento correto de documentos xml. Há uma grande variedade de tecnologias de identificação de versões em XML. As tecnologias fundamentais disponíveis para identificação de versões em um documento xml são:
Nomes Qualificados: Namespaces + Local Name.
As decisões sobre quais tecnologias usar são afetadas pelos requisitos gerais de idioma e pelos ambientes XML.
3.1 Nome Qualificado: Namespace + Local name.
A especificação Namespaces define um nome qualificado como o espaço de nome e o nome local de um. A partir de uma perspectiva de versão, estamos principalmente preocupados com nomes de elementos e atributos, e não com conteúdo. Uma motivação primária para Namespaces é a capacidade de extensibilidade descentralizada e a prevenção resultante da colisão de nomes.
Muitos sistemas usam informações de tipo associadas ao componente como parte da identificação da versão do componente. Geralmente, existem duas estratégias para determinar o tipo de componente, que chamaremos "Top-typing" e "Bottom-typing". Top-typing é um estilo em que o tipo do componente é determinado pelo tipo do elemento superior. A tipografia inferior é um estilo onde o tipo do componente é determinado pelo tipo ou tipos dos descendentes do elemento superior. Os projetos de digitação podem ser tais que um único tipo não é possível, mas é efetivamente o composto de todos os tipos descendentes. Quando os tipos superiores são estendidos, o tipo torna-se mais difícil de especificar. Pode ser o tipo superior, ou pode ser o tipo superior mais todos os tipos de extensão. Um nameType estendido com um MiddleNameType pode ser considerado um nameType ou um nameType + middleNameType. À medida que o número de tipos de extensão cresce, especificar o tipo real pode se tornar equivalente a alguns projetos de digitação. O extremo disto é o idioma do recipiente, que tem um único tipo de invariável e tipicamente destinado a ter o tipo determinado pelo conteúdo no "fundo" do contêiner.
Em qualquer caso de digitação, o (s) tipo (s) utilizado (s) para a determinação do tipo são determinados pelo tipo associado ao nome qualificado do componente durante a atribuição do tipo. No esquema XML, isso é durante a validação. Também é possível especificar o tipo na instância. O esquema XML fornece um atributo xsi: type que especifica o tipo do componente. Isso substitui a assinação entre o nome qualificado do componente e o tipo conforme especificado no esquema, ou fornece um tipo em que o nome qualificado do componente pode não ser resolvido em um tipo.
O XML Schema foi projetado para atribuir informações de tipo como parte da validação. Outras línguas, notadamente RelaxNG, não atribuem informações de tipo e não têm noção de tipos. A decisão de usar tipos e reutilizar tipos em todos os componentes é um fator importante na identificação da versão do componente porque a definição do componente e o tipo do componente podem ser versionados separadamente.
3.3 Números de versão.
Uma desvantagem significativa com o uso de identificadores de versão em XML é que o software que suporta ambas as versões do nome deve executar processamento especial em cima de XML e namespaces. Por exemplo, muitos componentes "ligam" os tipos XML em determinados tipos de linguagem de programação. O software personalizado deve processar o atributo de versão antes de usar qualquer um dos softwares "vinculativos". Nos serviços da Web, os kits de ferramentas geralmente tomam conteúdo de corpo de SOAP, analisam-no em tipos e invocam métodos nos tipos. Raramente há "ganchos" para o código personalizado para interceptar o processamento entre o processamento "SOAP" e o processamento do "nome". Além disso, se os atributos de versão forem utilizados por qualquer extensão de terceiros - digamos midns: o meio tem uma versão - então um esquema não pode se referir ao tipo médio correto.
4 Estratégias de identificação da versão do componente.
A estratégia para identificar a versão de um componente é talvez a decisão mais importante na concepção de uma linguagem XML. O uso de nomes de namespace, nomes de componentes, números de versão e informações de tipo são críticos para alcançar as características de versão de controle desejadas. As estratégias variam de muitos namespaces por versão de um idioma para apenas 1 namespace para todas as versões de um idioma. Alguns dos mais comuns estão listados abaixo e descritos com mais detalhes mais tarde.
ou seja, a primeira versão consiste em namespaces a + b, a próxima versão compatível ou incompatível consiste em namespaces c + d; ou a primeira versão consiste em namespace a, a próxima versão compatível ou incompatível consiste em namespace b.
ou seja, a primeira versão consiste em namespace a; A próxima versão compatível consiste em namespaces a + b; A próxima versão incompatível consiste em namespaces c + d.
ou seja, a primeira versão consiste em namespace a, a próxima versão compatível consiste em namespace a + b com adições ao namespace a.
ou seja, a primeira versão consiste em namespace a, a próxima versão compatível consiste em namespace a, a próxima versão incompatível consiste em namespace b.
ou seja, a primeira versão consiste em namespace a + b + versão atributo "1", a próxima versão compatível ou incompatível consiste em namespace c + d + atributo de versão "2".
ou seja, a primeira versão consiste em namespace um atributo de versão "1.0", a próxima versão compatível consiste em namespace a + atributo de versão "1.1", a próxima versão incompatível consiste em namespace a + atributo de versão "2.0".
Seja qual for o design escolhido, o designer de idioma deve decidir o nome do componente, nome do espaço para nome e qualquer identificador de versão para componentes novos e todos os componentes existentes.
Elaborar esses projetos é ilustrativo.
4.1 Estratégia de versão # 1: todos os componentes em novos namespace (s) para cada versão.
Os seguintes nomes seriam válidos:
Os 2º e 3º exemplos mostram todos os componentes no mesmo espaço de nome novo, com o 3º mostrando um novo nome também. O 4º e 5º exemplo mostram um elemento intermediário adicional em 2 nomes de namespace diferentes. O 4º exemplo vem de um nome de espaço para nome que está no mesmo domínio que o novo nome do nome do nome do espaço. Uma razão para 2 namespaces é modularizar o idioma. O 5º exemplo mostra um nome de espaço para nome de um domínio diferente para o meio.
4.1.1 Vantagens e desvantagens.
Nessa estratégia, não é desejável compatibilidade. Qualquer alteração ou extensão é uma mudança incompatível com um consumidor existente. Quando um consumidor antigo recebe os novos textos no novo espaço para nome, a maioria do software irá quebrar, como a realização de validação de esquema sem o novo esquema. A consecução da compatibilidade do avanço em partes de um sistema é possível e requer uma seleção cuidadosa das tecnologias, como as expressões XPath que são agnósticas do espaço de nomes. O efeito da mudança como uma mudança incompatível é o objetivo de design de alguns sistemas que adotaram essa estratégia.
4.2 Estratégia de versão 2: todos os novos componentes em novos namespace (s) para cada versão compatível.
Nesta estratégia, os seguintes nomes seriam válidos:
O 2º e 3º exemplo mostram um elemento intermediário adicional em 2 nomes de namespace diferentes. O primeiro meio, o 2º exemplo, vem de um nome de espaço de nomes que está no mesmo domínio que o nome do nome do nome do elemento. O 3º exemplo mostra um nome de espaço de nomes diferente para o meio. É provável que o midns: middle tenha sido criado pelo nome do autor, e o middiffdomain: middle foi criado por um terceiro.
4.2.1 Vantagens e desvantagens.
A compatibilidade com a frente e para trás pode ser suportada a partir da primeira versão. Este design impede que o designer de idiomas reutilize um nome de espaço para nome para alterações, o que pode ser desejável, pois a introdução de novos nomes de namespace pode ser difícil. XML Schema geralmente não suporta mais de uma revisão compatível do esquema nesta estratégia, conforme mostrado em 7.2 # 2: todos os novos componentes em novos namespace para cada versão compatível.
4.3 Estratégia de versão 2.5: todos os novos componentes em namespace (s) novos ou existentes para cada versão compatível.
Chamamos essa estratégia "2.5" porque é uma mistura de estratégia # 2 e estratégia # 3. Nesta estratégia, os seguintes nomes seriam válidos:
O 2º exemplo mostra o uso do nome do meio opcional no namespace do nome. O 3º e 4º exemplo mostra um elemento intermediário adicional em 2 nomes de namespace diferentes. O primeiro meio, o 3º exemplo, vem de um nome de espaço de nome que está no mesmo domínio que o nome do nome do nome do elemento. O 4º exemplo mostra um nome de espaço para nome diferente para o meio. É provável que o midns: middle tenha sido criado pelo nome do autor, e o middiffdomain: middle foi criado por um terceiro.
4.3.1 Vantagens e desvantagens.
A compatibilidade com a frente e para trás pode ser suportada a partir da primeira versão. Dependendo do design do esquema, alguns novos componentes não exigem uma alteração no espaço de nome. O XML Schema geralmente não suporta mais de uma revisão do esquema de forma compatível nos novos componentes em novos namespace (s) para cada estratégia de versão compatível, conforme mostrado em 7.2 # 2: todos os novos componentes em novos namespace (s) para cada versão compatível.
4.4 Estratégia de versão 3: todos os novos componentes em espaços de nomes existentes para cada versão compatível.
Nesta estratégia, os seguintes nomes seriam válidos:
O 2º exemplo mostra o uso do mesmo espaço de nomes porque o meio é opcional. O 3º exemplo mostra o uso do mesmo espaço de nomes porque o meio é opcional e o meio incorporado dentro de um "elemento de extensão". O 4º exemplo mostra o uso de um novo espaço para nome para todos os componentes, como um nome do meio obrigatório.
4.4.1 Vantagens e desvantagens.
A compatibilidade com versões anteriores e para a frente pode ser suportada a partir da primeira versão sem alterações no namespace. Isso significa que novos componentes não requerem novos espaços para nome, o que geralmente significa menos chance de uma evolução incompatível. O uso de namespace existente ou novo oferece ao designer de idiomas uma maior escolha no uso de nomes de namespace do que apenas usando um novo namespace. Como sempre, apenas o designer de idiomas tem a capacidade de usar e aumentar o nome do espaço para nome da primeira versão. O XML Schema não suporta o 2º exemplo em muitas situações devido à restrição de atribuição de partículas únicas. XML Schema suporta o 3º exemplo como mostrado em 7.4 # 3: Todos os novos componentes em namespace (s) existente para cada versão compatível.
4.5 Versioning Strategy # 4: todos os novos componentes em namespace (s) existentes ou novos para cada versão e um identificador de versão.
Usando um identificador de versão, as instâncias de nome mudariam para mostrar a versão do nome que usam, como:
Nos dois últimos exemplos, o número da versão foi alterado de 1.0 para 2.0. Incrementar a maior parte de um número de versão geralmente indica uma mudança incompatível. Nesse caso, talvez indique que o nome do meio agora é obrigatório onde anteriormente era opcional.
4.5.1 Vantagens e desvantagens.
A compatibilidade com versões anteriores e para a frente pode ser suportada a partir da primeira versão sem alterações no namespace. No entanto, o uso de números de versão significa que o relacionamento ou a ligação entre o Nome Qualificado de um componente e a interpretação de um idioma requerem o uso do número da versão. Isso significa que ferramentas de ligação gerais, como mapeamentos de XML para Java, geralmente não podem ser usadas autônomo.
4.6 Estratégia de versão # 5: todos os componentes nos namespace (s) existentes para cada versão e um identificador de versão.
Usando um identificador de versão, as instâncias de nome mudariam para mostrar a versão do nome que usam, como:
O 2º exemplo mostra que o meio é uma parte opcional do nome. O último exemplo mostra que o meio é uma parte obrigatória do nome.
4.6.1 Vantagens e desvantagens.
A compatibilidade com versões anteriores e para a frente pode ser suportada a partir da primeira versão sem alterações no namespace. O software que extrai o nome dado e o nome de família com base no nome qualificado muitas vezes não é quebrado porque um novo nome do namespace não é usado. No entanto, o uso de números de versão significa que o relacionamento ou a ligação entre o Nome Qualificado de um componente e a interpretação de um idioma requerem o uso do número da versão. Isso significa que ferramentas de ligação gerais, como mapeamentos de XML para Java, não podem ser usadas autônomo.
5 Indicando a compatibilidade de alterações ou extensões.
Como um designer de idiomas escolherá uma estratégia de identificação de versão de componente, eles também devem escolher como mudanças compatíveis ou incompatíveis serão indicadas.
5.1 Compatível.
Conforme mencionado na seção de compatibilidade de encaminhamento, a compatibilidade com avanço requer um mecanismo de substituição. Ignorar conteúdo desconhecido é um modelo muito popular. Pode ser especificado como padrão para quaisquer extensões. Também pode ser especificado em uma instância em que o padrão é para versões incompatíveis. Isso pode ser uma bandeira, como ns: mayIgnore = "true".
5.2 Incompatível.
Um autor de versão pode usar novos nomes de namespace, nomes locais ou números de versão para indicar uma alteração incompatível. Um autor de extensão pode não ter esses mecanismos disponíveis para indicar uma extensão incompatível. Um designer de linguagem que quer permitir que os autores de extensão indique que uma extensão é incompatível deve fornecer um mecanismo para indicar que os consumidores devem entender a extensão e o consumidor deve gerar um erro se não entender a extensão. Se apenas consumidores específicos devem entender a extensão, o designer de idiomas também deve fornecer um mecanismo para indicar quais consumidores. Se o designer de idiomas permitiu a compatibilidade com versões anteriores, a regra de compatibilidade de avanço deve ser superada.
Os idiomas com compatibilidade de compatibilidade com o suporte podem fornecer uma substituição para indicar extensões incompatíveis, mas só devem fazer isso se as extensões incompatíveis podem ser claramente segmentadas ou escopo.
5.2.1 Deve entender o sinalizador.
Provavelmente, o excesso de velocidade mais simples e flexível da técnica Must Ignore Unknowns é uma bandeira deve entender, que indica se o item deve ser entendido. Os atributos e valores de SOAP, WSDL e WS-Policy para especificar compreender são, respectivamente: soap: mustUnderstand = "1", wsdl: required = "1", wsp: Usage = "wsp: Required". O SOAP é provavelmente o caso mais comum de um recipiente que fornece um modelo de Compreender. O valor padrão é 0, que é efetivamente a regra Ignorar.
Um designer de idiomas pode reutilizar um modelo existente de compreensão obrigatória ao restringir seu idioma a um modelo existente deve entender. Uma série de especificações de serviços da Web fez isso especificando que os componentes são blocos de cabeçalho SOAP, o que traz explicitamente o modelo SOAP Must Understand.
Um designer de linguagem pode projetar um modelo de compreensão necessária em seu idioma. Um sinalizador de compreensão deve permitir ao produtor inserir extensões no contêiner e usar o atributo de compreensão necessária para superar a regra de ignorar deve ignorar. Isso permite que os produtores estendam instâncias sem alterar o namespace do pai do elemento de extensão, mantendo a compatibilidade com versões anteriores. Obviously the consumer must be extended to handle new extensions, but there is now a loose coupling between the language’s processing model and the extension’s processing model. A Must Understand flag is provided below:
An example of an instance of a 3rd party indicating that a middle component is an incompatible change:
Specification of a Must Understand flag must be treated carefully as it can be computationally expensive. Typically a processor will either: perform a scan for Must Understand components to ensure it can process the entire text, or incrementally process the instance and is prepared to rollback or undo any processing if an not understood Must Understand is found.
There are other refinements related to Must Understand. One example is providing an element that indicates which extension namespaces must be understood, which avoids the scan of the instance for Must Understand flags.
It is also possible to re-use the SOAP processing model with it's mustUnderstand. Use of a SOAP header for an extension may be because the body was not designed to be extensible, or because the extension is considered semantically separate from the body and will typically be processed differently than the body.
6 XML Schema 1.0.
XML Schema provides a variety of mechanisms for extensibility and versioning: wildcards, type extension, type restriction, redefine, substitution groups, and xsi:type attributes. The wildcard construct enables authors to create schemas that are both forwards and backwards-compatible. Generally, a new schema using wildcards is backwards compatible because it will validate old and new instances. The exception is instances that have content that is legal in the wildcard but not in the new content. An example might be a middle name that has structure or digits. However, that scenario means that an author created a middle name instance in the middle name namespace according to one schema AND an author defined a new middle name in the same namespace according to a different schema. Arguably there is an authority over the namespace that will prevent such clashes and so in practice this exception won't happen. Alternatively, we can make a slightly different compatibility guarantee, which is the new schema is backwards compatible with validate old and new instance where new instances do not have any extensions in the defined namespaces. The old schema is forwards compatible because it will validate old and new instances - of course it sees these as current and future instances.
When an author creates a new version, a new schema can created by the replacement of wildcard(s) in the original, with an optional-element, optional-wildcard sequence, in the later schema. The new schema explicitly states the entire new content model, including everything from the original schema as well as the new explicit declaration for middle, and for that reason we call it a "Complete Respecification" of the type.
A new type declared using wildcards could be declared as an explicit <xs:restriction/> of the original type, because every document accepted by the new type is also accepted by the old. XML Schema's type <xs:restriction/> allows alteration of wildcards anywhere in the content model, like Complete Respecification, but allows the original type to be preserved. Alternatively, XML Schema's type extension mechanism <xs:extension/> @@provide ref to Recommendation@@ provides a different way of specifiying a modified type, in which the original content is not restated, but only the new elements are explicitly referenced. The differences are: (1) xs:extension allows new content only at the end of the model and (2) using wildcards as shown above, the original type will accept not only documents in the original language, but also documents containing the middle name, something that's not true in typical uses of xs:extension. Thus the schema author of new version of a type has 3 options outlined above: 1) Complete Respecification without explicit use of xs:restriction; 2) Complete Respecification with explicit use of xs:restriction; 3) xs:extension.
These mechanisms can be combined together. For example, a schema that supports new components in existing or new namespaces and supports multiple schema versions (described in @@) uses wildcards, type extension, and use of Extension elements in instances.
Given an extensibility point that allows different namespaces, the language designer and 3rd parties can now use different namespaces for their versions. In general, an extension can be defined by a new specification that makes a normative reference to the earlier specification and then defines the new content. No permission should be needed from the authors of the specification to make such an extension. In fact, the major design point of XML namespaces is to allow decentralized extensions. The corollary is that permission is required for extensions in the same namespace. A namespace has an owner; non-owners changing the meaning of something can be harmful.
Attribute extensions can be in any namespace because in XML schema, attributes do not have non-determinism (aka Unique Particle Attribution) constraints that elements do. In XML Schema, the attributes are always unordered and the model group for attributes uses a different mechanism for associating attributes with schema types than the model group for elements. We will discuss this important issue later in the finding.
7 Schemas for Version Identification Strategies.
7.1 #1: all components in new namespace(s) for each version.
Using XML Schema 1.0, the name owner might like to write a schema such as:
The next version of the schema, with middle name added, might look like.
This schema is not perhaps quite what is desired because there are now 2 wildcards in the content model, the original wildcard then the new middle and the new wildcard. Type extension does not replace any existing wildcard trailing wildcard with the additive content. An alternative is to not have the wildcard in the first version but that removes forwards compatible extensibility as both sides must have the new schema to understand the type. Because of the type extension problem, the language designer cannot re-use the existing name definition and force a single wildcard at the end. They must create a new schema without any re-use of the previous schema's type information by respecifying the type. They can simply respecify the type or they can use xsd:restriction. Using xsd:restriction has some extra value in that a Schema processor can guarantee that the content model is a true restriction, but in general, respecification with or without xsd:restriction are equivalent.
The new namespace for all components does not allow compatible evolution by the language designer, unless they choose to put new components in a new namespace, which is strategy #2. Additionally, the version 2 schema cannot re-use the existing type definition.
7.2 #2: all new components in new namespace(s) for each compatible version.
We previously saw how re-use by importing and extending schemas with wildcards is not possible. In this strategy, the schema designer attempts to insert the new extension in the existing schema definition, like:
The Unique Particle Attribution(UPA) constraint of XML Schema, described in more detail in Unique Particule Attribution, prevents this from working. The problem arises in a version when an optional element is followed by a wildcard. In this example, this occurs when an optional element is added and extensibility is still desired. This is an ungentle introduction to the difference between extensibility and versioning. An optional middle name added into a subsequent version is a good example. Consumers should be able to continue processing if they don’t understand an additional optional middle name, and we want to keep the extensibility point in the new version. We can't write a schema that contains the optional middle name and a wildcard for extensibility. The previous schema schema is roughly what is desired using wildcards, but it is illegal because of the UPA constraint.
The author has 5 options for the v2 schema for name and middle, listed below and detailed subsequently:
the new middle is defined, extensibility is retained, and the new name type does not refer to the new middle;
the new middle is defined, extensibility is lost, and the new name type refers to the new middle as optional;
the new middle is defined, extensibility is retained, and the new name type refers to the new middle as required - the result is that compatibility is lost (essentially strategy #1);
the new middle is defined, extensibility is retained, and there is no new name type.
no update to the Schema.
If they leave the middle as optional and retain the extensibility point, the best schema that they can write is:
This is not a very helpful XML Schema change. The problem is that they cannot insert the reference to the optional midns:middle element in the name schema and retain the extensibility point because of the aforementioned Unique Particle Attribution Constraint.
The core of the problem is that there is no mechanism for constraining the content of a wildcard. For example, imagine that ns1 contains foo and bar. It is not possible to take the SOAP schema—an example of a schema with a wildcard - and require that ns1:foo element must be a child of the header element and ns1:bar must not be a child of the header element using just W3C XML Schema constructs. Indeed, the need for this functionality spawned some of the WSDL functionality.
They could decide to lose the extensibility point (option #2), such as.
This does lose the possibility for forwards-compatible evolution.
Option #3 is adding a required middle. They must indicate the change is incompatible. A new namespace name for the name element can be created. This is essentially strategy #1, new namespace for all components.
The downsides of the 3 options for new components in new namespace name(s) design have been described. Additionally, the design can result in specifications and namespaces that are inappropriately factored, as related constructs will be in separate namespaces.
7.2.1 Redefine.
Redefine allows incompatible and incompatible changes to be made to a type. Unlike other schema extension mechanisms which provide new names for extended or restricted types, redefine changes the definition of a type without changing its name. This means that the name alone is no longer sufficient to determine of two types are really the same. The schema author must take some caution to ensure that compatible changes are made. However, there are scenarios where redefine may be the right mechanism. In particular, an extension author may want to create a schema that is based upon a schema that they cannot change. In the previous examples, the middle author cannot change the nameType. However, they cannot use redefine to help them define a schema. Redefine using respecification, restriction, or extension do not allow a component in a new namespace to be added to the end of a sequence and retain the extensibility model. We showed the scenarios of adding the content at the end and the limitations of UPA hold true with and without Redefine. Redefine is usable when the extension author chooses to make an incompatible change (#3) or they can accept losing the extension point (#2).
7.3 #2.5: All new components in existing or new namespace(s) for each compatible version.
It is possible to create Schemas with additional optional components. This requires re-using the namespace name for optional components where possible, and use a new namespace where re-using the namespace is not possible. The re-using namespace rule is:
Re-use namespace names Rule: If a backwards compatible change can be made to a specification, then the old namespace name SHOULD be used in conjunction with XML’s extensibility model.
Strategy #1 uses a new namespace for all existing components and any additions, strategy #2 uses a new namespace for all additions (compatible and incompatible). strategy #3 re-uses namespaces for compatible extensions and uses a new namespace for all incompatible additions. Said slightly differently, strategies #1 and #2 use a new namespace name for any extension and strategy # 3 uses a new namespace only for incompatible change is made.
Earlier examples showed that it is not possible to have a wildcard with ##any (or even ##targetnamespace) following optional elements in the targetnamespace. This strategy is a "middle-ground" strategy, where the ##any is used wherever possible and ##other is used where ##any cannot be used. ##any can be used after mandatory elements or for attributes.
The addition of an optional middle can be done in the same namespace, but the wildcard must change to ##other.
7.4 #3: All new components in existing namespace(s) for each compatible version.
It is possible to create Schemas with additional optional components. This requires re-using the namespace name for optional components and special schema design techniques. The re-using namespace rule is:
Re-use namespace names Rule: If a backwards compatible change can be made to a specification, then the old namespace name SHOULD be used in conjunction with XML’s extensibility model.
Strategy #1 uses a new namespace for all existing components and any additions, strategy #2 uses a new namespace for all additions (compatible and incompatible). strategy #3 re-uses namespaces for compatible extensions and uses a new namespace for all incompatible additions. Said slightly differently, strategies #1 and #2 use a new namespace name for any extension and strategy # 3 uses a new namespace only for incompatible change is made.
New namespaces to break Rule: A new namespace name is used when backwards compatibility is not permitted, that is software SHOULD reject texts if it does not understand the new language components.
Earlier examples showed that it is not possible to have a wildcard with ##any (or even ##targetnamespace) following optional elements in the targetnamespace. The solution to this problem is to introduce an element in the schema that will always appear if the extension appears. The content model of the extensibility point is the element + the extension. There are two styles for this. The first, which we will call Extension element style, was published in an earlier version of this Finding in December 2003. It uses an Extensibility element with the extensions nested inside. The second, which we weill call Sentry style, was published in July 2004, then updated on MSDN. It uses a Sentry or Marker element with extensions following it.
A name type with extension elements is.
Because each extension in the targetnamespace is inside an Extension element, each subsequent target namespace extensions will increase nesting by another layer. While this layer of nesting per extension is not desirable, it is what can be accomplished today when applying strict XML Schema validation. It seems to at least this author that potentially having multiple nested elements is worthwhile if multiple compatible revisions can be made to a language. This technique allows validation of extensions in the targetnamespace and retaining validation of the targetnamespace itself.
The previous schema allows the following sample namens:
The namespace author can create a schema for this type.
The advantage of this design technique is that a forwards and backwards compatible Schema V2 can be written. The V2 schema can validate documents with or without the middle, and the V1 schema can validate documents with or without the middle. This is the only schema design that enables all versions of the language to have complete schemas.
Further, the re-use of the same namespace has better tooling support. Many applications use a single schema to create the equivalent programming constructs. These tools often work best with single namespace support for the “generated” constructs. The re-use of the namespace name allows at least the namespace author to make changes to the namespace and perform validation of the extensions.
An obvious downside of this approach is the complexity of the schema design. Another downside is that changes are linear, so 2 potentially parallel extensions must be nested rather than parallel.
7.4.1 Redefine.
The author could use redefine to add the middle in the same namespace. However, the first version does not allow extensions in the same namespace, so this is an incompatible change.
In the previous example, the author of the redefined schema replaced the type with an update. If the author of the nameType wanted to make the change, they could presumably just change the type without using redefine. In cases where the author of the extension is not the author of the base type, then redefine allows them to change the type. Some people may consider this an illegal redefinition of the nameType because they believe that only the namespace owner of the nameType should make changes to the type. Redefine also allows extension and restriction, subject to the limitations of them. Redefine does not help the nameType owner or an extension author create a revised type that refers to any new construct.
7.5 #4: all new components in existing or new namespace(s) for each version and a version identifier.
Using a version identifier, the name instances would change to show the version of the name they use, such as:
The last example shows a middle that is a mandatory part of the name, which is indicated by the use of a new major version number. As with Design #2, the schema for the optional middle cannot fully express the content model. A schema for the mandatory middle is.
A significant downside with using version identifiers is that software that supports both versions of the name must perform special processing on top of XML and namespaces. For example, many components “bind” XML types into particular programming language types. Custom software must process the version attribute before using any of the “binding” software. In Web services, toolkits often take SOAP body content, parse it into types and invoke methods on the types. There are rarely “hooks” for the custom code to intercept processing between the “SOAP” processing and the “name” processing. Further, if version attributes are used by any 3rd party extensions—say midns:middle has a version—then the schema cannot refer to the correct middle.
7.6 #5: all components in existing namespace(s) for each version and a version identifier.
Using a version identifier, the name instances would change to show the version of the name they use, such as:
This is not a very helpful XML Schema change. The problem is that they cannot insert the reference to the optional midns:middle element in the name schema and retain the extensibility point because of the aforementioned Unique Particle Attribution Constraint.
The last example shows that the middle is now a mandatory part of the name. As with Design #2, the schema for the optional middle cannot fully express the content model. A schema for the mandatory middle is.
This design has the significant drawback that XML Schema cannot be used for many of the changes. Because the same namespace is used for all versions of the language, then the wildcard namespace attribute must contain ##any . This means that any changes that are compatible, such as the addition of an optional middle in the 2nd example, cannot be completely modeled in XML Schema.
8 Indicating Incompatible changes.
A new qualified name can be created by specifying standalone content, respecifying existing content or by some kind of relationship with existing content. A variety of compatible extension mechanisms have been shown. There are more mechanism for incompatible changes in Schema 1.0.
8.1 Type extension.
A common option for indicating an incompatible change is to use type extension. The language designer allows for type extension, and they must specify that type extensions must be understood. Strategy #1 (all components in new namespace) shows a type extension schemas.
8.2 Substitution Groups.
Another mechanism for extending a type in XML Schema is substitution groups. Substitution groups enable an element to be declared as substitutable for another. This can only be used for incompatible extensions as the consumer must understand the new element and the schema that contains the substitution type. Substitution groups require that elements are available for substitution, so the name designer must have provided a name element in addition to the name type.
A schema for a substitution group is provided below:
Substitution groups do allow a single extension author to indicate that their changes are mandatory. The limitations are that the extension author has now taken over the type’s extensibility. A visual way of imagining this is that the type tree has now been moved from the language designer over to the extensions author. And the language designer probably does not want their type to be “hijacked”.
However, this is not substantially different than an extension being marked with a “Must Understand”. In either case—with the extensions higher up in the tree (sometimes called top-typing) or lower in the tree (bottom-typing)—a new type is effectively created.
The difference is that there can only be 1 element at the top of an element hierarchy. If multiple mandatory extensions are added, then the only way to compose them together is at the bottom of the type because that is where the extensibility is.
Substitution groups do not allow a language designer and an extension author to incompatibly change the language as they end up conflicting over what to call the name element. Thus substitution groups are a poor mechanism for allowing an extension author to indicate that their changes are incompatible. A Must Understand flag is a superior method because it allows multiple extension authors to mix their mandatory extensions with a language designer’s versioning strategy. Hence language designers should prevent substitution groups and provide a Must Understand flag or other model when they wish to allow 3rd parties to make incompatible changes.
In some cases, a language does not provide a Must Understand mechanism. In the absence of a Must Understand model, the only way to force consumers to reject a message if they don’t understand the extension namespace is to change the namespace name of the root element, but this is rarely desirable.
8.3 Must Understand.
Each of the various component identification schemes can support a mustUnderstand flag. Two schema for a Must Understand flag are provided below:
An example of an instance of a 3rd party indicating that a middle component is an incompatible change:
9 Survey of Languages Versioning Strategies.
We can examine a variety of languages for their versioning strategies.
WS-Policy 1.5 uses ##any for attributes and PolicyReference element extensibility, and ##other for other extensibility points.
SVG specifies an extension entity for extending most of the SVG elements, it specifies that fallbacks can be provided for unknown elements and that processing can be aborted.
UBL extensions are incompatible by UBL definition.
XSLT 2.0 has very powerful versioning features. The version of the processor can be tested, fallbacks can be provided for unknown elements and processing can be aborted.
10 Unique Particle Attribution.
This Finding has spent considerable material describing content models valid under Unique Particle Attribution constraints, and so it is worth describing the W3C XML Schema Unique Particle Attribution constraint in more detail. The reader is reminded that these rules are unique to W3C XML Schema and that other XML Schema languages like RELAX NG do not use these rules and so do not suffer from the contortions one is forced through when using W3C XML Schema. XML DTDs and W3C XML Schema have a rule that requires schemas to have content models valid under the Unique Particle Attribution constraint. From the XML 1.0 specification,
“For example, the content model ((b, c) | (b, d)) is non-deterministic, because given an initial b the XML processor cannot know which b in the model is being matched without looking ahead to see which element follows the b.”
The use of ##any means there are some schemas that we might like to express, but that aren’t allowed.
Wildcards with ##any, where minOccurs does not equal maxOccurs, are not allowed before an element declaration. An instance of the element would be valid for the ##any or the element. ##other could be used.
The element before a wildcard with ##any must have cardinality of maxOccurs equals its minOccurs. If these were different, say minOccurs=”1” and maxOccurs=”2”, then the optional occurrences could match either the element definition or the ##any. As a result of this rule, the minOccurs must be greater than zero.
Derived types that add element definitions after a wildcard with ##any must be avoided. A derived type might add an element definition after the wildcard, then an instance of the added element definition could match either the wildcard or the derived element definition.
Follow Unique Particle Attribution constraint: Use of wildcards MUST be follow the Unique Particle Attribution constraint. Location of wildcards, namespace of wildcard extensions, minOccurs and maxOccurs values are constrained, and type restriction is controlled.
As shown earlier, a common design pattern is to provide an extensibility point—not an element - allowing any namespace at the end of a type. This is typically done with <xs:any namespace=”##any”>.
Unique Particle Attribution makes this unworkable as a complete solution in many cases. Firstly, the extensibility point can only occur after required elements in the original schema, limiting the scope of extensibility in the original schema. Secondly, backwards compatible changes require that the added element is optional, which means a minOccurs=”0”. The Unique Particle Attribution constraint prevents us from placing a minOccurs=”0” before an extensibility point of ##any. Thus, when adding an element at an extensibility point, the author can make the element optional and lose the extensibility point, or the author can make the element required and lose backwards compatibility.
11 Other technologies.
The W3C XML Schema Working has heard and taken to heart many of these concerns. They have plans to remedy some of these issues in XML Schema 1.1. A Working Draft[@@] and a Guide 2 versioning using the new XML Schema 1.1 features [@@] are available.
A simple analysis of doing compatible extensibility and versioning using RDF and OWL is available [21]. In general, RDF and OWL offer superior mechanisms for extensibility and versioning. RDF and OWL explicitly allow extension components to be added to components. And further, the RDF and OWL model builds in the notion of “Must Ignore Unknowns” as an RDF/OWL processor will absorb the extra components but do nothing with them. An extension author can require that consumers understand the extension by changing the type using a type extension mechanism.
RELAX NG is another schema language. It explicitly allows extension components to be added to other components as it does not have the Unique Particle Attribution constraint.
12 Conclusion.
This Finding describes a number of questions, decisions and rules for using XML, W3C XML Schema, and XML Namespaces in language construction and extension. The main goal of the set of rules is to allow language designers to know their options for language design, and ideally make backwards - and forwards-compatible changes to their languages to achieve loose coupling between systems.
13 References.
14 Acknowledgements.
The author thanks the many reviewers that have contributed to the article, particularly David Bau, William Cox, Ed Dumbill, Chris Ferris, Yaron Goland, Hal Lockhart, Mark Nottingham, Jeffrey Schlimmer, Cliff Schmidt, and Norman Walsh.
eBay Schema Versioning Strategy.
As of August 2018, the lowest supported version is 863 .
This topic describes eBay's versioning strategy for the Trading API (and Shopping API), which enables us to evolve the schema while maintaining backward compatibility for at least 18 months. This strategy is intended to address these concerns:
eBay adds new features every two weeks. If you update your client software less frequently, your software needs a way to handle unrecognized data from eBay. Over time, it becomes more difficult for eBay to support third-party software that is using outdated business logic or features. eBay needs a way to eventually drop support for outdated features. We understand that it may be difficult for you to update your software on short notice. To help you, eBay needs to maintain support for outdated features for some period of time, and we need to give you as much notice as possible before we completely stop supporting a feature.
In each release, we do our best to update the schema in a backward-compatible way. However, sometimes we need to make changes that aren't backward compatible:
As XML schema constructs are typed, any modification that would result in a type change is a potential incompatibility. As a very simple example, we might currently express a measurement or a count in integer values ( xs:int ), but in a future enhancement we might need a way to allow decimal fractions for the same value ( xs:double ). If your application is expecting a field to return an integer at runtime and we start returning a double instead, your application could fail. So, we need a way to avoid changing the type directly. Changing the multiplicity of an element is also a potential incompatibility. For example, we might currently allow a single URL field, but in a future enhancement we might allow repeating URL fields ( maxOccurs="unbounded" ). As some toolkits interpret repeating fields as arrays, this would be equivalent to a type change.
When such changes are necessary, we need a way to gracefully phase in the new approach and gracefully phase out the old one. (That is, we need to make changes without causing third-party applications to fail unexpectedly, and applications need to be designed to accommodate routine changes.) This approach is described below.
Basic Schema Concepts.
Before reading this document, you should be familiar with these basic concepts.
Versioning Strategy Key Points.
This section summarizes key points you should understand about our versioning strategy. These points are explained in more detail in later sections.
A deprecated object is an object that we no longer recommend. The schema version when this deprecation occurs is the object's deprecation version . For example, if we deprecated an object called "Flavor" in version 803 of the schema, then the deprecation version for that object was 803.
Whenever we deprecate an object, we also delete the object from the latest schema at the same time (unless otherwise noted). Your application should not be affected by these deletions until you upgrade to a newer version of the schema. (See the object deprecation schedule for a list of previously deprecated objects that have been deleted from the schema.)
We control a deprecated object's usage based on the request version:
If it's an input object, you may only receive a warning (regardless of the request version). If it's an output object, we only return it with request versions that are lower than the deprecation version (unless otherwise noted). See Object Deprecation Example below for an example of how this works. If it was deprecated earlier than the lowest supported version (see below), it will no longer work.
We increment the lowest supported version every 6 months. The lowest supported version will be 18 months old. See eBay's Version Support Schedule.
eBay's Version Support Schedule.
In February and August of each year, eBay increments the lowest supported schema version.
The table below shows eBay's schema version support schedule. The row with bold text indicates the current lowest supported version. Rows with gray text indicate future versions that are not yet published or past versions that are no longer supported.
Version Support Schedule (Projected)
Here's an example of how to interpret the table:
As of February 2018, the lowest supported version is 837. In August 2018, we increment the lowest supported version to 863. If you upgrade to version 861, before August 2018, you would be able to use 861 until August 2018 (when the lowest supported version moves to 863).
Here's how this schedule will affect you:
If your application is using a version lower than the lowest supported version, you should upgrade your software to use a supported version. You are encouraged to use one of the most recent versions available. If you are creating a new application, you are required to use the latest version available.
Important: Once a schema version is no longer supported, objects that were deprecated as of that version (or earlier) are not supported , regardless of the request version.
Schema Changes That Affect Compatibility.
eBay makes three basic kinds of changes to the schema:
We add new objects. We deprecate existing objects. We replace existing objects or change their type.
In many cases, these changes will not affect your application until you upgrade to a newer schema. The effects can depend on whether your application happens to use the functionality that has changed, and the version of the schema you are using.
We do our best to keep you informed of schema changes through the schema documentation, release notes, the eBay Developer Program Blog, site status, and other mechanisms.
Addition of New Objects.
We can introduce new objects at any time and at any level of the schema.
Usually, the request version doesn't control your ability to use new elements or calls (unless otherwise noted). For example, new output elements are usually returned for all request versions. We add an xs:any element to the end of each type to express this openness. By policy we also try to add elements to the end of a type before the xs:any element. (This is only a policy; it's not a guarantee.)
However, the request version does control whether we return new code type values (enumerations) in responses. If your software is already using an element that is a code type, you need a safe way to handle new values that your software doesn't recognize yet. Therefore, we check your request version, and then in our response we map any newer code type values to a default value you can recognize (CustomCode) instead. (See Overview of the API Schema for more information about code types.)
For backward compatibility:
You should design your software to be able to handle or gracefully ignore extra elements that we add to the schema. For example, at any time, API calls may return new elements in addition those declared in the version of the schema you are using. Your software should also be prepared to see and handle "CustomCode" (without quotes) for values that we have added to code types in versions that are newer than your current request version.
Deprecation of Existing Objects.
As stated earlier, a deprecated object is an object that we no longer recommend (although we still support it). We do our best not to deprecate objects, but sometimes it becomes necessary to deprecate an object due to business, legal, or functional issues. The schema version when this deprecation occurs is the object's deprecation version .
Here's what happens in the API:
When we deprecate an object, we delete it from the schema at the same time. (If your application already uses the object, you should not be affected until you upgrade to the deprecation version or higher.) When we increment the lowest supported schema version, we will drop support for all objects that were deprecated in lower versions. See eBay's Version Support Schedule.
Here's the behavior you can expect:
Your application should not be affected by newly deleted objects as long as you are using good coding practices. For example, you should not hard-code a check for, say, "the 20th element" in the response. For backward compatibility, how you use a deprecated object depends on whether the object is in the request (input) or the response (output). The policy in the table below assumes that the deprecation version and your request version are both supported (i. e., greater than the lowest supported version).
See Object Deprecation Example for a concrete example, including a diagram.
When testing a call, you can set WarningLevel to High to identify whether you are using deprecated objects in your request.
Replacements and Type Changes.
We sometimes need to effectively change an existing object to a different type, or replace or rename an object. Rather than replacing an object directly, we usually use the addition and deprecation approaches described above. That is, we add a new object with a different name and we deprecate the old object.
For backward compatibility:
Treat the new object like any other new object. It will be available regardless of the request version (unless otherwise noted). See Addition of New Objects above. Treat the old object like any other deprecated object. See Deprecation of Existing Objects above.
Client software that depends on the old object should start using (or expecting) the new one as soon as possible. This is particularly important if the old object reflects functionality that is inconsistent with current eBay site logic. Otherwise, your application's users may see unexpected (and undesirable) behavior.
In some cases, we may change an existing object's behavior without replacing it. See Logical Changes That Affect Compatibility for an example. Again, we do our best to minimize these kinds of changes.
Object Deprecation Example.
Let's suppose eBay offers a new "flavor" feature, and then later enhances the feature in a way that isn't backward compatible.
This is how the schema and the object's usage might change in this case:
Logical Changes That Affect Compatibility.
Incompatible changes can be logical or functional; not necessarily changes to the schema itself. As with deprecated objects, we implement these kinds of changes based on the version whenever possible.
For example, suppose a call returns a node called ManyDetails :
In version 483, we always return ManyDetails . In version 503, we add a new IncludeManyDetails field to the request, and we set the default to false (so that ManyDetails is only returned when you specifically ask for it).
In this example, we are not deprecating ManyDetails or changing the schema in any way, but this change would break any application that specifically looks for ManyDetails and expects it to be returned by default. Therefore, we would implement this change so that only clients specifying request version 503 or higher would see the new behavior.
See the Version-Dependent Logical Changes table for a summary of objects that behave differently based on the request version.
Schema Versions and Requirements for Compatible Application Check.
To comply with eBay's requirements for Compatible Application Check, new applications must use the latest version that is available in the Production environment at the time of Compatible Application Check.
For example, suppose your application had a Compatible Application Check at version 525. If version 555 is the latest version available in production, then you can still use version 525 or higher .
On the other hand, suppose you submit a new request for a Compatible Application Check. If version 555 is the latest version available in production, you would need to use the latest version (555 in this example).
We increment the lowest supported version periodically. Make sure you understand how your application will be affected by these changes (see eBay's Version Support Schedule). Plan to start adjusting your application to use the latest version before we drop support for the version you are using. (You do not necessarily need to redo a Compatible Application Check for your application if you are only upgrading it to a newer version.)
Upgrading Applications to Support New Versions.
At a high level, we suggest you follow this process when you upgrade an application to a newer version of the schema:
Make sure the application uses no invalid objects or functionality. For example: For each call, remove dependencies on objects that have been deprecated for the version you are upgrading to. For each call, make sure the request only includes applicable and valid fields. For example, certain fields that are valid in AddItem calls may be invalid in ReviseItem calls. Use the Sandbox to test your application's compatibility with the new version. Make sure that all requests trigger no warnings or errors. Set WarningLevel to High to make sure no schema warnings are returned.
What is a Compatibility Level?
You may see some people use the older term "compatibility level" instead of "request version" in the Forums, KB articles, obsolete documentation, and other resources. The term is also used in the X-EBAY-API-COMPATIBILITY-LEVEL header, for XML requests. This is simply an older name for the request version.
Direitos autorais e cópia; 2005–2018 eBay, Inc. All rights reserved. This documentation and the API may only be used in accordance with the eBay Developers Program and API License Agreement.
Document not found.
Sorry, the document you requested is not available. Here are some steps you may try to find the page you were looking for:
If you typed the URL by hand then please make sure that it is exactly as it should be. Also check the capitalization and that you are using forward slashes ( / ). If you are looking for information on a particular subject, please start on the W3C Home page or Site Map. Try searching the site using the search box at the top of this page.
The W3C Webmaster FAQ has answers to frequently asked questions about our site.
Comments
Post a Comment