Capítulo de livro Revisado por pares

A Type Safe DOM API

2005; Springer Science+Business Media; Linguagem: Inglês

10.1007/11601524_11

ISSN

1611-3349

Autores

Peter Thiemann,

Tópico(s)

Service-Oriented Architecture and Web Services

Resumo

DOM (Document Object Model) is the W3C recommendation for an API for manipulating XML documents. The API is stated in terms of a language neutral IDL with normative bindings given for Java and ECMAScript. The type system underlying the DOM API is a simple object-based one which relies entirely on interfaces and interface extension. However, this simplicity is deceiving because the DOM architects implicitly impose a large number of constraints which are only stated informally. The long list of exceptions that some DOM methods may raise witnesses these constraints. The present work defines a refinement of Java's type system which makes most of these constraints accessible and thus checkable to the compiler. Technically, we graft a polymorphic annotation system on top of the host language's types and propagate the annotations using ideas borrowed from affine type systems. We provide a type soundness proof with respect to an operational semantics of a Java core language.

Referência(s)